SecKeyGetCredentials
Returns an access credential for a key.
Declaration
OSStatus SecKeyGetCredentials(SecKeyRef keyRef, CSSM_ACL_AUTHORIZATION_TAG operation, SecCredentialType credentialType, const CSSM_ACCESS_CREDENTIALS **outCredentials);Parameters
- keyRef:
The key for which you want an access credential.
- operation:
The type of operation to be performed with this key. Possible values are listed under “Authorization tag types” in
Security.framework/cssmtype.h. - credentialType:
The type of credential requested. See Seccredentialtype for possible values.
- outCredentials:
On return, points to an access credential 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
A result code. See Security Framework Result Codes.
Discussion
An access credential is required as an input to a number of CSSM functions.