Function

SecKeyCopyPublicKey(_:)

Gets the public key associated with the given private key.

Declaration

func SecKeyCopyPublicKey(_ key: SecKey) -> SecKey?

Parameters

key

The private key for which you want the corresponding public key.

Return Value

The public key corresponding to the given private key.

See Also

Key Generation

Generating New Cryptographic Keys

Create both asymmetric and symmetric cryptographic keys.

Storing Keys in the Secure Enclave

Create an extra layer of security for your private keys.

Key Generation Attributes

Use attribute dictionary keys during cryptographic key generation.