Skip to main content
Version: 6.0.0

SignRSASha256

Given a piece of data and a private key, calculates an SHA-256 with RSA (SHA256withRSA) signature for the data. Encoded as a base64 string. This signature can then be verified as authentic by a receiver with access to an associated public key.

Note that the implementation supports both PKCS1 and PKCS8 RSA format private keys.

Method Parameters​

ParameterDescription
privateKeyThe private key used to generate the signature
dataStringThe data string to calculate the signature for

Usage​

http://localhost:3000
// Cloud Code only. To view example, switch to the Cloud Code tab
JSON Response
{
"data": {
"response": {
"signature": "V3iD/yE3G9s4vgB6TeF+HOCKEb9CmF8iPSE+dK3MAS991U0NXDIwJzyuzFxiJWIt2W8WtKfQJqpOITsMPmgxY0Ttj0yfG0uS7jjRr5/vtC3/ZNWrzmyXSiunDmPwmJ36PVuPjyVxLtZzkr4qw/l/7lAKcNz8515Dgjs2RQHC1EtRrmHpaMpWL32Ya8CKtmjkNdHI2Ng9MrvVp+aaIPCPGoLPWis+zD+ZxNr+i6c0BP8RQVqigS4Bnt/YBeLE+ZuAD/0puC6Kc2/AO1Sqgo6g927VUjGOVM7JqVAq0JZY8XG9K+OgL6VJuBfKCDaQ2HUV+MWhaxFA3vageIqG+6eIOA=="
},
"success": true
},
"status": 200
}