This guide provides Node.js examples for generating RSA-4096 key pairs, signing request bodies, verifying signatures, and securely calling the Liquidity API.
Generating RSA-4096 Key Pair#
Use Node.js's built-in crypto module to generate a secure RSA-4096 key pair.Signing Request Body#
Sign the raw request body using an RSA-4096 private key and return a base64-encoded signature.Verifying Signatures (For Testing)#
Use the public key to verify locally whether the generated signature matches the original body.Full Example with Logging & Error Handling#
Includes: private key validation, request signing, and common endpoint helpers.Environment Variables Setup#
Use .env to store API credentials and private key paths securely.Security Best Practices#
Modified at 2025-07-10 08:45:38