Upload certificate chain
Stores a certificate chain on a key, usually the chain that a CA issued for a CSR of Generate CSR. The key then has x5c and can sign with cryptographicKeyFormat x509. A chain that the key already has is replaced.
The key store must have the capability certificateChain (local, vault, gcp-kms, aws-kms, azure-key-vault, dpod); a key of a remote signing key store gets its chain from the QTSP. To add a key and its chain in one step, use Import key.
Send a multipart/form-data body with a UTF-8 PEM file in certificate_file: the leaf certificate first, then the intermediate certificates, then the root. The wallet refuses a file with a private key, a leaf that is not for the key or not P-256, a certificate that is expired or not yet valid, and a chain signature that does not verify.
The wallet checks the leaf against the certificate preset of the newest CSR of the key (extended key usage, key usage, subject alternative names, validity and, for an ISO/IEC 18013-5 preset, the issuer). A difference gives the warning profile-mismatch, not an error. After the upload, certificateSource is uploaded and certificatePreset is that preset. A test certificate that the key had goes into the CRL of its test CA. An upload of the current test certificate of the key itself keeps certificateSource test-ca, with the first warning test-certificate.
A new chain can make a credential configuration that signs with the key no longer fit its credential category. The upload still succeeds: affectedCredentialConfigurations lists these configurations, which then show does-not-fit in signingKeyCheck. Issuance does not stop, and a save of their credential definition is not refused.
Authorizations
AuthorizationstringheaderrequiredYour API key with the prefix
ApiKey:ApiKey <your-api-key>. Get an API key.Scope:
keys:update
Path parameters
keyId stringrequiredThe
keyIdof a key of the organisation, from List keys or from the answer of Create key. It is also thekidof its JWK.
Body
The PEM file with the certificate chain.
certificate_file filerequiredA UTF-8 PEM file with the certificates in leaf, intermediate, root order, and no private key.
Response
The key now has the chain. The answer gives the thumbprints, the check against the preset and the affected credential configurations.
key_id stringThe key ID.
Example:
"3f2a91c47b8d4e6fa0c5d7e18b924f30"certificates_count integerThe number of certificates in the chain.
Example:
3x5tstringThe SHA-1 thumbprint of the leaf certificate, base64url (
x5tof the JWK).Example:
"<base64url-sha1-thumbprint>"x5t_s256 stringThe SHA-256 thumbprint of the leaf certificate, base64url (
x5t#S256of the JWK).Example:
"<base64url-sha256-thumbprint>"csrId string | nullThe ID of the newest CSR of the key, the one that the check used.
nullwhen the key has no stored CSR.Example:
"5e1c2f7a-8b3d-4c6e-9f0a-1b2c3d4e5f60"presetstring | nullThe certificate preset of that CSR.
nullwhen there is none.Example:
"mdoc-document-signer"warningsobject[]The warnings (
profile-mismatch,purpose-reuse;test-certificatefirst when the leaf is the current test certificate of the key). An empty list when there are none.affectedCredential Configurations object[]The credential configurations whose signing key check fitted with the old chain and gives
does-not-fitwith the new one. An empty list when there are none.