Hello everyone,
I’m building an open source encrypted chat using openpgp.js, but have a
question on encrypting private key.
Firstly, I got the encrypted private key via:
var key = openpgp.generateKeyPair({numBits: 2048, userId: userid,
passphrase: passphrase});
var encryptedPrivateKey = key.privateKeyArmored;
Then I want to change the passphrase for encrypted private key to a new
one, let’s say "passphrase_2”, without need to re-generate the key pair.
Then I would need to decrypt “encryptedPrivateKey” and encrypt with “
passphrase_2”. Something like:
encryptedPrivateKey.decrypt(passphrase);
encryptedPrivateKey.re_encrypt(passphrase_2);
Could someone provide some sample code to do that with openpgp.js?
Thank you so much!
Best,
Dayne
_______________________________________________
http://openpgpjs.org
Subscribe/unsubscribe: http://list.openpgpjs.org