Skip to main content
Test certificates

Create test certificate

POST/v4/config/ows/key-management/keys/{keyId}/test-certificate

Gives a key a test certificate of the built-in test CA of the organisation in one call: the wallet makes the CSR with the key, the test root issues the leaf, and the wallet stores the chain (the leaf and the root) on the key. For development and testing only: the test CA is on no trusted list, and wallets and verifiers outside this platform do not trust it. The answer always has the warning test-certificate.

The body is a CsrRequest (see Generate CSR) with an optional validityDays. The leaf has exactly the values of the request and the certificate preset. The test root of the trust domain of the preset (testCaDomain in List certificate presets) issues it. When the organisation has no root of that domain yet, the wallet makes it first, with this country:

  • mdoc-iaca: subject.country of the request, else the country of the newest CA-issued leaf of a key of the organisation, else EU.
  • provider and access: the country of the newest CA-issued leaf of a key of the organisation, else subject.country, else EU.

To choose the country of a root before its first test certificate, use Create test CA. ISO/IEC 18013-5 needs the same country in the Document Signer, the IACA and the mdoc issuing_country: for mdoc-document-signer, mdoc-reader and the *-mdoc presets, another subject.country than the root gives the warning profile-mismatch.

After the call, certificateSource is test-ca and testCertificate is true, and the key can sign with cryptographicKeyFormat x509; a signature carries the leaf only. A key that already has a test certificate gets a new one, and the old leaf goes into the CRL. A key with a chain from another CA is refused: Delete certificate chain first. The key store must have the capabilities csr and certificateChain.

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

application/json

The certificate preset and the values of the certificate (CsrRequest), and the optional validity.

  • presetenum<string> | null

    The certificate preset. An unknown value gives 400 (preset: unknown preset; use one of <the preset ids>).

    Available options:wrpac-legal,wrpac-natural,pid-provider,wallet-provider,wallet-status-list-signer,eaa-provider,qeaa-provider,pub-eaa-provider,mdoc-document-signer,pid-provider-mdoc,eaa-provider-mdoc,qeaa-provider-mdoc,pub-eaa-provider-mdoc,mdoc-reader,mdoc-status-list-signer,status-list-signer,request-signer-san-dns,custom

    Example:"mdoc-document-signer"

  • subjectobject

    The subject of the certificate, one value for each attribute. An attribute that the request does not give takes the prefill of the certificate preset; null means no value. The wallet encodes the subject in X.500 order, from the country to the common name. emailAddress is not allowed: put an email address in subjectAltName.email.

  • subjectAltNameobject

    The subject alternative names of the certificate, at most 50 values of each kind. A kind that the request does not give takes the prefill of the certificate preset. The wallet checks the format of each value and refuses a repeated value.

  • keyUsageobject | null

    The key usage extension. null means no key usage extension.

  • extendedKeyUsageobject | null

    The extended key usage extension. null means no extended key usage extension.

  • certificatePoliciesstring[] | null

    The certificate policies as OIDs in dotted form, at most 20, each once. For example 0.4.0.194118.1.2 (NCP-l-eudiwrp, ETSI TS 119 411-8).

  • qcStatementsobject | null

    The QC statements. null means no QC statement.

  • validityDaysinteger | null

    The validity of the test certificate in days, at most the maxValidityDays of the certificate preset. Default the testCertificateValidityDays of the preset.

    From 1 to 3650.

    Example:365

Response

application/json

The key with its new test certificate, the warnings and the affected credential configurations.

  • keyobject

    A signing key of the organisation, with its key store, its public JWK and what its certificate allows. It has public values only, never the private key, the name of the key at the provider or a secret. The wallet key of the organisation (the automatic key that the wallet creates at the deployment, the holder identity of the organisation wallet) is not a signing key, and no key answer has it while it has no certificate chain.

  • warningsobject[]

    The warnings, test-certificate first, then any of preset-override, purpose-reuse and profile-mismatch.

  • affectedCredentialConfigurationsobject[]

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