Contents

SecCertificateCopyPublicKey(_:)

Retrieves the public key from a certificate.

Declaration

func SecCertificateCopyPublicKey(_ certificate: SecCertificate) -> SecKey?
func SecCertificateCopyPublicKey(_ certificate: SecCertificate, _ key: UnsafeMutablePointer<SecKey?>) -> OSStatus

Parameters

  • certificate:

    The certificate object from which to retrieve the public key.

  • key:

    In macOS, points to the public key for the specified certificate. In Objective-C, call the Cfrelease function to release this object when you are finished with it.

Mentioned in

Return Value

In iOS, the certificate’s public key.

Discussion

In macOS, a result code. See Security Framework Result Codes.