addX509Cert

suspend fun addX509Cert(certificate: X509Cert, metadata: TrustMetadata): TrustEntryX509Cert

Adds a new entry for CAs identified by a X.509 certificate.

The entry will be persisted in the Storage passed at construction time.

The SubjectKeyIdentifier of certificate is used to identify the certificate.

Return

the TrustEntryX509Cert which was added.

Parameters

certificate

the root X509 certificate for the CA, must have SubjectKeyIdentifier set.

metadata

the metadata for the trust point.

Throws

if there already is another trust point with the same SubjectKeyIdentifier.