Function

SecCertificateCreateWithData(_:_:)

Creates a certificate object from a DER representation of a certificate.

Declaration

func SecCertificateCreateWithData(_ allocator: CFAllocator?, _ data: CFData) -> SecCertificate?

Parameters

allocator

The CFAllocator object you wish to use to allocate the certificate object. Pass NULL to use the default allocator.

data

A DER (Distinguished Encoding Rules) representation of an X.509 certificate.

Return Value

The newly created certificate instance. Returns nil if the data passed in the data parameter is not a valid DER-encoded X.509 certificate.

Discussion

The certificate object returned by this function is used as input to other functions in the API.

See Also

Import and Export

Storing a DER-Encoded X.509 Certificate

Import and export a certificate from a file.

func SecCertificateCopyData(SecCertificate) -> CFData

Returns a DER representation of a certificate given a certificate object.