How to manage trusted verifier certificates
Add, list and remove the verifier root CA certificates your wallet trusts, so the Holder SDK can authenticate in-person, remote and Digital Credentials API presentation requests.
The Holder SDK reports a presentation request as trusted only when the verifier's certificate chain ends at a certificate your wallet trusts. You provision these trusted verifier certificates through the SDK. A single store is used for every presentation channel: in-person, remote (OpenID4VP) and the Digital Credentials API.
Obtain the certificates from the verifiers you work with, or from the trust framework your wallet participates in, for example a RICAL.
Which certificates to add
Each certificate you add becomes a trust anchor:
- iOS: Each certificate must be self-signed, either a verifier root CA certificate or a
self-signed leaf certificate. Other certificates are rejected with
MobileCredentialHolderError.failedToStoreCertificate, and none of the certificates in that call are stored. - Android: You can add a verifier root CA certificate or an intermediate CA certificate. Trusting
an intermediate CA certificate limits trust to the verifiers beneath it. When a request chains to a
trusted intermediate,
VerifierInfo.commonNameandtrustedVerifierCertificateIdrefer to that intermediate.
Certificates are supplied as PEM-encoded or Base64-encoded DER strings. Adding a certificate is idempotent: adding the same certificate again returns the identifier of the existing entry rather than creating a duplicate.
Add, list and remove certificates
Use addTrustedVerifierCertificates, getTrustedVerifierCertificates, and deleteTrustedVerifierCertificate:
let mobileCredentialHolder = MobileCredentialHolder.shared
// Add one or more trusted verifier certificates (PEM or Base64 DER).
let addedIds = try mobileCredentialHolder.addTrustedVerifierCertificates(
certificates: [verifierCertificatePem]
)
// List the stored trusted verifier certificates.
let stored: [TrustedCertificate] = try mobileCredentialHolder.getTrustedVerifierCertificates()
// Remove one by its identifier.
try mobileCredentialHolder.deleteTrustedVerifierCertificate(certificateId: addedIds[0])Each stored certificate is a TrustedCertificate carrying its id, pem, and commonName.
Next steps
How would you rate this page?
Last updated on