SecCertificate

class SecCertificate : _CFObject

Helpful SecCertificate extensions.

  • Retrieve the byte representation of the certificate.

    Declaration

    Swift

    var data: Data { get }
  • Retrieve the PEM formatted string representation of the certificate.

    Declaration

    Swift

    var pemString: String { get }
  • Retrieve the public key of the certificate as SecKey.

    Declaration

    Swift

    var publicKey: SecKey? { get }
  • Retrieve the Subject Public Key Info bytes of the certificate. Only RSA 2048, 3072, 4096, ECDSASECP256r1 and ECDSASECP384r1 keys are supported at this time. Will return nil for other key types.

    Declaration

    Swift

    var spki: Data? { get }