Instantly share code, notes, and snippets.

Embed
What would you like to do?
Code snippet on how to create a pair of keys using the MessageMedia Signature Key Management Node.js SDK.
const lib = require('messagemedia-signingkeys-sdk');
// Configuration parameters and credentials
lib.Configuration.basicAuthUserName = "API_KEY"; // The username to use with basic authentication
lib.Configuration.basicAuthPassword = "API_SECRET"; // The password to use with basic authentication
var controller = lib.SignatureKeyManagementController;
// The body of the request
var body = new lib.CreateSignatureKeyRequest({
"digest": "SHA224",
"cipher": "RSA"
});
// POSTing the request to the endpoint
controller.createSignatureKey(body, function(error, response, context) {
console.log(response);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment