Skip to main content
Certificates

Generate CSR

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

Makes a certificate signing request (CSR) for a key: the key store signs it, and the wallet stores it. Send the CSR to your CA, then upload the issued chain with Upload certificate chain. For development and testing, Create test certificate does both steps with the built-in test CA.

The key store must have the capability csr (local, vault, gcp-kms, aws-kms, azure-key-vault, dpod). A key of a remote signing key store (csc) gets its certificate from the QTSP.

The body is a CsrRequest. Give the preset of the purpose of the key (List certificate presets): each member that you leave out takes the prefill and the fixed values of the preset, and a value that differs from a fixed value gives the warning preset-override. Use one key for each purpose: a CSR with another preset than the chain of the key gives the warning purpose-reuse.

The wallet checks the request first. An invalid value gives 400 with <field>: <problem>, where <field> is the path of the member (for example subjectAltName.dns.0). The main checks:

  • subject.country is an ISO 3166-1 alpha-2 code (Greece is EL in an identifier), and the subject has one value for each attribute and no emailAddress.
  • With a preset that has etsiSyntax true, subject.organizationIdentifier and subject.serialNumber follow ETSI EN 319 412-1 (for example VATSE-556677889901, TINSE-1234567890).
  • The DNS names, URIs, email addresses and telephone numbers of subjectAltName are well formed.
  • keyUsage.values has no keyEncipherment, dataEncipherment or CA key usage.
  • qcStatements.qcPsb has all three values, and countryOfLegislation is a country code or EU.
  • The fields in required of the preset are there, for example subject.commonName: required by the preset mdoc-document-signer.

A missing subject.country, subject.organization or subject.commonName takes the prefill of the organisation, also without a preset: send null for no value. The subject is encoded in X.500 order, from the country to the common name. The CA decides what goes into the certificate; Upload certificate chain checks the issued certificate against the preset of the newest CSR of the key.

The older flat body (commonName, organization, sanDns and the other fields at the top level) gives 400 <field>: unknown field: put these values in subject and subjectAltName.

Authorizations

  • Authorizationstringheaderrequired

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

    Scope:keys:sign

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 CSR (CsrRequest). Give the subject values that your CA registered for your organisation.

  • 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,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

    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.

Response

application/json

The CSR, stored with its preset and its request.

  • csrstring

    The CSR in PEM format.

    Example:"-----BEGIN CERTIFICATE REQUEST----- <base64-csr-content> -----END CERTIFICATE REQUEST----- "

  • csrIdstring

    The ID of the stored CSR.

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

  • presetstring | null

    The certificate preset of the request. null when the request has no preset.

    Example:"mdoc-document-signer"

  • warningsobject[]

    The warnings (preset-override, purpose-reuse). An empty list when there are none.