Function

SecKeyGeneratePairAsync

Generates a public/private key pair.

Declaration

void SecKeyGeneratePairAsync(CFDictionaryRef parameters, dispatch_queue_t deliveryQueue, SecKeyGeneratePairBlock result);

Parameters

parameters

A key generation parameter dictionary. At minimum, this must contain kSecAttrKeyType and kSecAttrKeySizeInBits. In addition, this function assumes default values for the following keys:

These default values can be overridden by adding a value for the associated key in the parameter dictionary.

deliveryQueue

The dispatch queue on which the result block should be scheduled.

result

A block of type SecKeyGeneratePairBlock that gets called with the result upon completion.

See Also

Legacy macOS Key Operations

SecKeyGenerateSymmetric

Generates a random symmetric key.

SecKeyCreateFromData

Constructs a SecKeyRef object for a symmetric key.

SecKeyDeriveFromPassword

Returns a key object in which the key data is derived from a password.

SecKeyWrapSymmetric

Wraps a symmetric key with another key.

SecKeyUnwrapSymmetric

Unwraps a wrapped symmetric key.

SecKeyGetCredentials

Returns an access credential for a key.

Deprecated
SecKeyGetCSPHandle

Returns the CSSM CSP handle for a key.

Deprecated
SecKeyGetCSSMKey

Retrieves a pointer to the CSSM_KEY structure containing the key stored in a keychain item.

Deprecated
SecKeySizes

The supported sizes for keys of various common types.

SecKeyUsage

The flags that indicate key usage in the KeyUsage extension of a certificate.

SecPublicKeyHash

A container for a 20-byte public key hash.

SecKeyCreatePair

Creates an asymmetric key pair and stores it in a keychain.

Deprecated
SecKeyGenerate

Creates a symmetric key and optionally stores it in a keychain.

Deprecated
SecKeyGeneratePairBlock

A block called with the results of a call to SecKeyGeneratePairAsync.

SecCredentialType

The credential type to be returned by SecKeyGetCredentials.