Code Samples
Examples of code to interact with Nirova API
Signature generation and validation
All examples imply that you have already generated ssl-rsa key-pair with such command:
openssl genrsa -out private.pem 2048
and extracted public key:
openssl rsa -in private.pem -pubout > public.pub
General workflow
Signing:
Staging environment is available at
Prerequisite:
- generate private and public key.
- send public key to Nirova representative
Process:
- sign request body with your private key
- encode signature in base64
- put result of step 2 into header X-Nirova-Signature
- send request
Process:
- sign request body with your private key
- encode signature in base64
- put result of step 2 into header X-Nirova-Signature
- send request
Signing:
Prerequisite: receive and save Nirova public key
Process:
- receive request
- get value of X-Nirova-Signature header
- decode it from base64
- check that result of step 3 is valid for combination of this request body and Nirova public key
Examples
We have few code examples for generating of signature and it's validation. Also priv folder contains omed pair of private and public keys.
- Elixir
- NodeJS
- Java
- PHP
- .NET
- Bash
- Python