Contents

SecCertificateCopySerialNumber(_:)

Returns a copy of a certificate’s serial number.

Declaration

func SecCertificateCopySerialNumber(_ certificate: SecCertificate) -> CFData?
func SecCertificateCopySerialNumber(_ certificate: SecCertificate, _ error: UnsafeMutablePointer<Unmanaged<CFError>?>?) -> CFData?

Parameters

  • certificate:

    The certificate from which the serial number should be copied.

  • error:

    A pointer to a Cferror variable where an error object is stored upon failure. If not NULL, the caller is responsible for checking this variable and releasing the resulting object if it exists.

Return Value

A data instance containing a DER-encoded integer for the certificate’s serial number (without the tag and length fields) or nil if an error occurred. In Objective-C, free this object with a call to CFRelease when you are done with it.