API Crypto is an API maintained by Sensedia and which is pre-registered on the API Manager. You can use it to perform encryption operations. These operations can be used on other interceptors' flow, such as Digital Signature and Encrypt.

This page shows examples on how to use each API resource.
This resource generates a digest from an algorithm, data, and a salt. As of now, the algorithm available for the hash function is PBKDF2-HMAC-SHA1.
This is an example of using this resource with the required payload, and after that a code block of a payload with all possible attributes for the hash function.
TIPSalts are important to avoid dictionary attacks, since they are concatenated with the data before being processed by the hash function, adding randomness to the digest generated.
Example of digest generated from a given piece of data using a PBKDF2-HMAC-SHA1 function:
Name | Description |
|---|---|
| Content-Type | Should be application/json |
| Authorization | Basic client_id:client_secret (Base64) |
CAUTIONAll endpoints of this API are protected with the Client Id Secret Encoded Validation interceptor. Thus, all requests must contain the
Authorizationheader described above.
There are optional attributes in the body that, when not informed, assume the default value of:
NOTEThe attribute
saltTypetreats the reported salt type and can assume HEX (Hexadecimal) or ASCII (String) values.
digestTypetreats the returned digest type and can assume HEX (Hexadecimal) or Base64 values.
The response will bring its digest with fixed size, according to the hash algorithm used.
The resource keys generates pairs of public-private keys.
These keys are essential if you are using the Digital Signature interceptor, but the resource works regardless of interceptors.
That is, you can use it to generate keys for the most diverse contexts.
The resource has the following methods and endpoints:
The method above generates a pair of keys. As a requirement, it needs a payload containing what type of algorithm will be used to generate the keys.
Example generating RSA keys:
Once the request is done, a pair of keys will be contained in the response:
NOTEAs of now, the types supported are
RSAandAES.
In addition to the endpoint described above, there is also an endpoint exclusively for the obtention of a public key:
It's easy to use this endpoint. A GET request will return an RSA public key, as in the example below:
This resource signs a key. A use case for the Platform is described on the Digital Signature interceptor's flow.
The backend expects a payload with the following properties:
Once the request is done, the signature will be in the response body.
TIPAs described above, more examples on how to use the resources
signandkeyson the Platform can be found on the page regarding the Digital Signature interceptor.
The resource verify has only one endpoint, which validates key and signature.
The request must contain a JSON with some required properties:
The response will contain only one property, indicating whether key and signature are valid.
There is a Swagger file for API Crypto. You can see it to check the DTOs (Data Transfer Objects) used for each endpoint, which helps to understand the payloads and the way each resource works. This is the URI to access the Swagger interface:

For more examples regarding using API Crypto, check the pages on the interceptors Digital Signature and Encrypt.
We use cookies to enhance your experience on our site. By continuing to browse, you agree to our use of cookies.Learn more