Requesting timestamps from Rest PKI
You can use Rest PKI as an ICP-Brasil timestamp provider through the TSP protocol (Timestamp Protocol, RFC 3161) or the REST API.
To do this, follow the steps below to get an access token:
- Sign in to the Rest PKI website (https://pki.rest/)
- On the Control Panel, click the Generate new access token button
- Copy the generated value
Then use one of the ways below to communicate with Rest PKI.
Communication through the Timestamp Protocol
Use these settings to communicate with Rest PKI over TSP:
- Protocol: HTTPS
- Method: POST
- URL:
https://pki.rest/tsp/a402df41-8559-47b2-a05c-be555bf66310 - Authentication: by HTTP header as below:
Authorization:Bearer <Rest PKI access token>
Communication through the REST API
Use these settings to call the Rest PKI REST API:
- URL:
https://pki.rest/Api/TimestampPlans/a402df41-8559-47b2-a05c-be555bf66310/Issue - Method: POST
- Request headers
Authorization:Bearer <Rest PKI access token>Content-Type:application/json
- Request
algorithm: algorithm name (see the supported algorithms below)value: hash value to be stamped, Base64 encoded orhexValue: hash value to be stamped, encoded in hexadecimal (case insensitive)
- Response
encodedValue: timestamp, Base64 encodedinfo: information about the timestamp
Example request with SHA-256 algorithm and Base64 hash:
{
"algorithm": "SHA256",
"value": "L80RIvFw2jwpiObzFQN+tuEQQ4E9qnGeYYYd+4DrM8M="
}
Example request with SHA-1 algorithm and hash in hex:
{
"algorithm": "SHA1",
"hexValue": "3ade2832feafe081f246aa2fb89cb9c7929ac911"
}
Supported algorithms
Currently, the following algorithms are supported:
- SHA-1
- TSP: 1.3.14.3.2.26
- API: "SHA1"
- SHA-256
- TSP: 2.16.840.1.101.3.4.2.1
- API: "SHA256"