diff options
Diffstat (limited to 'lib/crypto.js')
-rw-r--r-- | lib/crypto.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/crypto.js b/lib/crypto.js index c4256609b..16a3e38e2 100644 --- a/lib/crypto.js +++ b/lib/crypto.js @@ -355,6 +355,16 @@ Verify.prototype.verify = function(object, signature, sigEncoding) { return this._handle.verify(toBuf(object), toBuf(signature, sigEncoding)); }; +exports.publicEncrypt = function(object, buffer) { + return binding.publicEncrypt(toBuf(object), buffer); +}; + +exports.privateDecrypt = function(options, buffer) { + var key = options.key || options; + var passphrase = options.passphrase || null; + return binding.privateDecrypt(toBuf(key), buffer, passphrase); +}; + exports.createDiffieHellman = exports.DiffieHellman = DiffieHellman; |