exports.signAndEncryptData = function(passphrase, plaintext, recipient_public_key, keystore) { var key_str = sjcl.decrypt(passphrase, keystore ); var RSAKey = cryptico.rsa_key_from_string(key_str); return cryptico.encrypt(plaintext, recipiant_public_key, RSAKey); }
exports.decryptData = function(passphrase, cipherText, keystore) { var key_str = sjcl.decrypt(passphrase, keystore ); var RSAKey = cryptico.rsa_key_from_string(key_str); return cryptico.decrypt(cipherText, RSAKey); }