Upload certificate chain
POST/v2/config/digital-wallet/openid/key-management/keys/:keyId/certificate-chain
Uploads a certificate chain and links it to a key. The wallet then adds the chain as the x5c value of the key, and the key can sign with the x509 format. A chain that the key already has is replaced.
This operation is for keys in a key store with the capability certificateChain: local, vault, gcp-kms, aws-kms, azure-key-vault and dpod. A key of a QTSP (csc) gets its certificate from the QTSP. To add a key and its chain in one step, use the import key operation (local and vault only).
The file must be UTF-8 text in PEM format. Put the leaf certificate first, then the intermediate certificates, then the root certificate. The service refuses the file when it holds a private key, when the leaf certificate does not use the P-256 curve, when a certificate is expired or not yet valid, or when a chain signature is not correct.
The wallet checks the leaf certificate against the preset of the newest CSR of the key (the generate CSR operation): the extended key usage, the key usage, the subject alternative names, the validity and, for an ISO/IEC 18013-5 preset, the issuer. A difference gives the warning profile-mismatch, not an error: the wallet refuses only a chain that it cannot use to sign. After the upload, certificateSource of the key is uploaded and certificatePreset is the preset of that CSR (null when the key has no CSR with a preset). When the key had a test certificate, the test CA revokes it (CRL). Exception: an upload of the current test certificate of the key itself (the leaf that the built-in test CA issued for this key, not revoked) keeps certificateSource test-ca and the certificatePreset of the key, the test CA does not revoke that leaf, and the first warning is test-certificate.
A new chain can break a credential configuration that signs with the key: its certificate no longer fits the credential category of the configuration, or no longer has the ISO/IEC 18013-5 Document Signer profile of an mDL. The upload still succeeds, and affectedCredentialConfigurations lists these configurations. They then show does-not-fit in their signingKeyCheck, and issuance does not stop.
Request
Path Parameters
Unique identifier of the key
- multipart/form-data
Body
required
PEM file that holds the certificate chain.
PEM file that holds the certificate chain in leaf, intermediate and root order. The file must not hold a private key.
Responses
- 200
- 400
- 401
- 404
- 500
Certificate chain uploaded successfully.
Response Headers
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- ]
- Array [
- ]
Unique identifier of the key that the certificate chain belongs to.
Number of certificates in the uploaded chain.
SHA-1 thumbprint of the leaf certificate, in base64url format.
SHA-256 thumbprint of the leaf certificate, in base64url format.
Unique identifier of the newest CSR of the key, the CSR of the check. null when the key has no stored CSR.
The preset of the check, the preset of the newest CSR of the key. null when there is none.
warnings object[]required
The warnings of the upload (profile-mismatch, purpose-reuse). An empty list when there is none. When the uploaded leaf is the current test certificate of the key, the first warning is test-certificate.
Possible values: [test-certificate, preset-override, profile-mismatch, purpose-reuse]
The kind of warning. test-certificate, the answer issues or shows a certificate of the built-in test CA: the text is always the text of the example. preset-override, a value of the request is not the fixed value of the preset; the request value applies. profile-mismatch, the certificate does not agree with the preset of the key. purpose-reuse, the certificate chain of the key has a preset, and the new CSR, test certificate or chain upload has another preset: use one key for each purpose.
The text of the warning, for a person.
affectedCredentialConfigurations object[]required
The credential configurations whose signing key check fitted with the old chain and gives does-not-fit with the new chain. An empty list when there is none.
The credential definition of the configuration.
The credential configuration id, as in the OID4VCI Credential Issuer Metadata.
The label of the configuration, else its display.name, else the label of the credential definition.
The id of a credential category (the list credential categories operation): the eIDAS category of a credential configuration. none (no certificate rule), pid (person identification data), eaa (non-qualified attestation), qeaa (qualified attestation) or pub-eaa (attestation issued by or for a public sector body).
The rules that the new certificate does not fit, with the fix, as in signingKeyCheck.messages.
{
"key_id": "3f2a91c47b8d4e6fa0c5d7e18b924f30",
"certificates_count": 3,
"x5t": "<base64url-sha1-thumbprint>",
"x5t_s256": "<base64url-sha256-thumbprint>",
"csrId": "5e1c2f7a-8b3d-4c6e-9f0a-1b2c3d4e5f60",
"preset": "mdoc-document-signer",
"warnings": [],
"affectedCredentialConfigurations": []
}
The key ID is missing, the file is not valid PEM, the file holds a private key (use the import key operation, POST /v2/config/digital-wallet/openid/key-management/keys/import, to import a key with its certificate chain), the leaf certificate is not for the public key of the key (Certificate public key does not match the stored key) or does not use the P-256 curve, a certificate is expired, a chain signature is not correct, or the key store of the key cannot take a certificate chain (The key store <key store name> cannot store a certificate chain; the QTSP of the key store gives the chain.).
Response Headers
- application/json
- Schema
- Example (from schema)
Schema
{
"errorCode": 400,
"errorDescription": "Bad input parameter"
}
Unauthorized
Response Headers
- application/json
- Schema
- Example (from schema)
Schema
{
"errorCode": 400,
"errorDescription": "Bad input parameter"
}
The organisation has no key with this key ID.
Response Headers
- application/json
- Schema
- Example (from schema)
Schema
{
"errorCode": 400,
"errorDescription": "Bad input parameter"
}
Internal server error
Response Headers
- application/json
- Schema
- Example (from schema)
Schema
{
"errorCode": 400,
"errorDescription": "Bad input parameter"
}