Installation and usage of the platform

REST API: retrieving certificates

To request a certificate from a node certificate store use the methods from the pki/certificate group. With these methods you can retrieve a certificate by different fields:

In the request, these methods take the value of the corresponding certificate field and, optionally, the plainText parameter, which determines the format of the response.

If a certificate exists, the node returns the certificate in DER format (as it is recorded in the node certificate store), with bytes encoded in Base64 format in the response of each of these methods. If the plainText parameter in the method request is set to true, then the certificate is returned in plainText format.

If no such certificate exists, then each of these methods returns an error with the 404 Not Found code.

/pki/certificate group methods authorization

In case of API-KEY, authorization is not required.

In case of OAuth2 authorization, the user role in JWT token is required.

GET /pki/certificate/by-dn/%percent-encoded-DN%

The method returns the certificate by its distinguished name recorded in the DN field.

An example of the GET /pki/certificate/by-dn/%percent-encoded-DN% method request:

GET /pki/certificate/by-dn/%percent-encoded-DN%:

Request:

{
  "DN": "CN=Steve Kille,O=Isode Limited,C=GB",
  "plainText": false
}

GET /pki/certificate/by-dn-hash/%DN-hash-string%

The method returns the certificate by SHA-1 hash (Keccak) from the DN certificate field.

GET /pki/certificate/by-public-key/%public-key-base58%

The method returns the certificate by its publicKey.

GET /pki/certificate/by-fingerprint/%fingerprint-base64%

The method returns the certificate by its fingerprint.

See also