Signing Certificates
Both the issuer and the verifier sign what they send, and both carry their certificate chain in the signature so the
receiving party can check it. This is how trust is established, so signing is a required
setting: a tenant cannot be created without it.
The signing block
The two services take the same block, in the settings a tenant is created with. The key and the certificates are PEM text, shortened here:
"signing": {
"private_key": "-----BEGIN PRIVATE KEY-----\n…\n-----END PRIVATE KEY-----\n", // (1)!
"certificate_chain": [ // (2)!
"-----BEGIN CERTIFICATE-----\n…\n-----END CERTIFICATE-----\n"
]
}
- The PEM-encoded EC private key used to sign. Required.
- The certificate chain, ordered leaf first. Required. These are emitted verbatim as the JOSE
x5cheader of everything the service signs.
jq --rawfile reads a PEM file into a JSON string; Creating a tenant shows
it.
The service keeps the key and the chain in its database and signs with them for as long as the tenant exists — see Rotation.
Order matters in certificate_chain
The list is a chain, not a set. The leaf — the certificate matching private_key — comes first, then each
issuing certificate in turn. A chain in the wrong order will be rejected by the party validating it, and nothing
validates the order when the tenant is created.
Generating a pair for local use
For local testing, a self-signed EC P-256 pair per service is enough:
for b in issuer verifier; do
mkdir -p "$b/conf/signing-key"
openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:P-256 -nodes \
-keyout "$b/conf/signing-key/$b-localhost.key" \
-out "$b/conf/signing-key/$b-localhost.pem" \
-days 365 -subj "/CN=localhost" -sha256
done
Give each service its own pair. Sharing one between the issuer and the verifier makes their identities indistinguishable to a wallet, since both derive their identity from the certificate.
What a self-signed certificate can and cannot do
A self-signed certificate proves possession of a key. It does not connect that key to anything a third party already trusts, which has different consequences on each side:
- The verifier. Its OID4VP
client_idisx509_hash:followed by a hash of its leaf certificate, and a wallet validates the request's chain against its own trusted roots before showing the consent screen. A wallet you control can be told to accept your self-signed certificate; wallets you do not control will refuse the request. See Trust model. - The issuer. Credentials it signs carry its chain. A verifier that performs path validation — which is the case for mdoc credentials — accepts them only if the chain reaches one of that verifier's configured trust anchors.
So a self-signed pair is right for local development and for a closed setup where you configure both ends. Facing wallets or verifiers you do not operate, you need a certificate issued by an authority they already recognize. See Going to production.
Rotation
Certificates expire, and the pair generated above is valid for 365 days.
Rotating the verifier's certificate changes its client_id, because the identifier is derived from the
certificate. Any wallet or configuration that pinned the old value has to be updated.
Rotating the issuer's certificate does not invalidate credentials already issued: each credential carries the chain that was current when it was signed, and that chain remains verifiable until its own certificates expire. To keep older credentials verifiable across a rotation, keep the retiring certificate available to whoever validates paths rather than removing it the moment the new one is in place.
Plan rotation before the expiry date. Neither service warns you that a certificate is close to expiring.
What's Next
- Issuer trust anchors: The other half — which issuers your verifier accepts.
- Trust model: Why the chain is what establishes trust.
- Going to production: Moving off self-signed certificates.