Contents

SecIdentityCopyCertificate(_:_:)

Retrieves a certificate associated with an identity.

Declaration

func SecIdentityCopyCertificate(_ identityRef: SecIdentity, _ certificateRef: UnsafeMutablePointer<SecCertificate?>) -> OSStatus

Parameters

  • identityRef:

    The identity object for the identity whose certificate you wish to retrieve.

  • certificateRef:

    On return, points to the certificate object associated with the specified identity. In Objective-C, call the Cfrelease function to release this object when you are finished with it.

Mentioned in

Return Value

A result code. See Security Framework Result Codes.

Discussion

An identity is a digital certificate together with its associated private key.

For a certificate in a keychain, you can cast the SecCertificateRef data type to a SecKeychainItemRef for use with Keychain Services functions.