A wrapper for OpenSSL's rsautl
A thin wrapper for OpenSSL's rsautl(1) for those precious few cases where native bindings won't work.
$ npm install rsautl
var rsautl = require'rsautl';var privateKey = '...';var publicKey = '...';rsautlencrypt'Encrypt me please!' publicKey// encrypted contains a base64 encoded encrypted stringif err return console.logerr;rsautldecryptencrypted privateKeyif err return console.logerr;console.logdecrypted; // Encrypt me please!;;rsautlsign'Sign me please!' privateKey// signed contains a base64 encoded signed stringif err return console.logerr;rsautlverifysigned publicKeyif err return console.logerr;console.logverified; // Sign me please!;;
This code writes private keys to temporary files in order for openssl(1) to read them. Make sure your tempfs is based in memory. If you can, use native binding implementations.
This is free software released under the Simplified BSD License. See the LICENSE file for further information.