init(version:serialNumber:publicKey:notValidBefore:notValidAfter:issuer:subject:signatureAlgorithm:extensions:issuerPrivateKey:)

Construct a certificate from constituent parts, signed by an issuer key.

Certificate.swift:181
iOS
13+
macOS
10.15+
tvOS
13+
watchOS
6+
init(version: Version, serialNumber: SerialNumber, publicKey: PublicKey, notValidBefore: Date, notValidAfter: Date, issuer: DistinguishedName, subject: DistinguishedName, signatureAlgorithm: SignatureAlgorithm, extensions: Extensions, issuerPrivateKey: PrivateKey) throws

Parameters

version

The X.509 specification version for this certificate.

serialNumber

The serial number of this certificate.

publicKey

The public key associated with this certificate.

notValidBefore

The date before which this certificate is not valid.

notValidAfter

The date after which this certificate is not valid.

issuer

The DistinguishedName of the issuer of this certificate.

subject

The DistinguishedName of the subject of this certificate.

signatureAlgorithm

The signature algorithm that will be used to produce signature. Must be compatible with the private key type.

extensions

The extensions on this certificate.

issuerPrivateKey

The private key to use to sign this certificate.

This API can be used to construct a Certificate directly, without an intermediary Certificate Signing Request. The signature for this certificate will be produced automatically, using issuerPrivateKey.

This API can be used to construct a self-signed key by passing the private key for publicKey as the issuerPrivateKey argument.