Merchant Key Exchange Procedure
Method
Signature is used to ensure data integrity and authenticity of the request or response for each API. The signature needs to be provided using a private key. Our system supports the use of PKCS#1 for the private key, thus merchant should generate the signature with rsa_private_key.pem. The generated signature will be verified using a public key with rsa_public_key.pem.
Credentials for SNAP API
There will be a set credentials for SNAP API, which are:
- Client Key (Will be used as X-Client-Key and X-Partner-ID in request header)
- Public Key given by Durianpay (Will be used for decrypting request coming from us)
- Merchant's Private key (Will be used for encrypting asymmetric X-Signature)
- Secret Key (Will be used for encrypting symmetric X-Signature)
Please refer to next sections for usage details
Generate Private/Public Key Pair
Run this command on your terminal
Generate Private Key
bash/zsh
openssl genrsa -out rsa_private_key.pem 2048
Generate Public Key
bash/zsh
openssl rsa -in rsa_private_key.pem -out rsa_public_key.pem -pubout
You will need to send the generated keys to Durianpay team in zip format.