Created
July 23, 2010 11:41
-
-
Save hackervera/487331 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Needed to create a cert for public key