Skip to main content
Certificates

Upload certificate chain

POST/v4/config/ows/key-management/keys/{keyId}/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

  • Authorizationstringheaderrequired

    Your API key with the prefix ApiKey: ApiKey <your-api-key>. Get an API key.

    Scope:keys:update

Path parameters

  • keyIdstringrequired

    The keyId of a key of the organisation, from List keys or from the answer of Create key. It is also the kid of its JWK.

Body

multipart/form-data

The PEM file with the certificate chain.

  • certificate_filefilerequired

    A UTF-8 PEM file with the certificates in leaf, intermediate, root order, and no private key.

Response

application/json

The key now has the chain. The answer gives the thumbprints, the check against the preset and the affected credential configurations.

  • key_idstring

    The key ID.

    Example:"3f2a91c47b8d4e6fa0c5d7e18b924f30"

  • certificates_countinteger

    The number of certificates in the chain.

    Example:3

  • x5tstring

    The SHA-1 thumbprint of the leaf certificate, base64url (x5t of the JWK).

    Example:"<base64url-sha1-thumbprint>"

  • x5t_s256string

    The SHA-256 thumbprint of the leaf certificate, base64url (x5t#S256 of the JWK).

    Example:"<base64url-sha256-thumbprint>"

  • csrIdstring | null

    The ID of the newest CSR of the key, the one that the check used. null when the key has no stored CSR.

    Example:"5e1c2f7a-8b3d-4c6e-9f0a-1b2c3d4e5f60"

  • presetstring | null

    The certificate preset of that CSR. null when there is none.

    Example:"mdoc-document-signer"

  • warningsobject[]

    The warnings (profile-mismatch, purpose-reuse; test-certificate first when the leaf is the current test certificate of the key). An empty list when there are none.

  • affectedCredentialConfigurationsobject[]

    The credential configurations whose signing key check fitted with the old chain and gives does-not-fit with the new one. An empty list when there are none.