Function

SecKeyGetCSPHandle

Returns the CSSM CSP handle for a key.

Declaration

OSStatus SecKeyGetCSPHandle(SecKeyRef keyRef, CSSM_CSP_HANDLE *cspHandle);

Parameters

keyRef

The key for which you want a CSSM CSP handle.

cspHandle

On return, points to the CSSM CSP handle for the specified key. This pointer remains valid until the key reference is released. Do not attempt to modify or free this data.

Return Value

Discussion

A CSSM CSP handle is required as an input to a number of CSSM functions.

See Also

Legacy macOS Key Operations

SecKeyGeneratePairAsync

Generates a public/private key pair.

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
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.