Skip to content

Instantly share code, notes, and snippets.

@hackervera
Created July 23, 2010 11:41
Show Gist options
  • Save hackervera/487331 to your computer and use it in GitHub Desktop.
Save hackervera/487331 to your computer and use it in GitHub Desktop.
var crypto = require('crypto');
var fs = require('fs');
var key = fs.readFileSync("/home/tyler/keys/tyler.pem").toString();
var publicKey = fs.readFileSync("/home/tyler/keys/tyler-public.pem").toString();
var text = "hello there";
var signature = crypto.createSign('RSA-SHA256').update(text).sign(key);
var verified = crypto.createVerify('RSA-SHA256').update(text).verify(publicKey,signature);
console.log(ver);
@hackervera
Copy link
Author

Needed to create a cert for public key

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment