SignRSASha256
Given a piece of data and a private key, calculates an SHA-256 with RSA (SHA256withRSA) signature for the data. 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
Parameter | Description |
---|---|
privateKey | The private key used to generate the signature |
dataString | The data string to calculate the signature for |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
var privateKey = "aPrivateKey";
var dataString = "String to sign";
var response = {};
response.signature = bridge.utils().signRSASha256( privateKey, dataString );
// Return the result
response;
var privateKey = "aPrivateKey";
var dataString = "String to sign";
var response = {};
response.signature = bridge.utils().signRSASha256( privateKey, dataString );
// Return the result
response;
JSON Response
{
"data": {
"response": {
"signature": "acdUTXOT8P5q7W6h+IGZYp8s5Vnxj8RvQLRGdYz7ufJ/hxboDetxxxxxxvjDuKlvBrgE/mWg9d+j36EbWkDIDbOhGl61ec0n/ZeYnc7M5j55G1BDATWLu/zzbVwNr+jYVXjlQ7T+/GUpiLvI+vUA5Uv/AQlbQOoeKyzM="
},
"success": true
},
"status": 200
}