From e450582888f2414af3d5748845c67c036be1f849 Mon Sep 17 00:00:00 2001 From: Akihito Mikazuki Date: Fri, 9 Jul 2021 12:05:09 -0400 Subject: [PATCH] Update README to use `openpgp.readPrivateKey()` where applicable (#1362) --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 09ea0d27..a5b86c10 100644 --- a/README.md +++ b/README.md @@ -213,7 +213,7 @@ const openpgp = require('openpgp'); // use as CommonJS, AMD, ES6 module or via w const publicKey = await openpgp.readKey({ armoredKey: publicKeyArmored }); const privateKey = await openpgp.decryptKey({ - privateKey: await openpgp.readKey({ armoredKey: privateKeyArmored }), + privateKey: await openpgp.readPrivateKey({ armoredKey: privateKeyArmored }), passphrase }); @@ -293,7 +293,7 @@ If you expect an encrypted message to be signed with one of the public keys you const publicKey = await openpgp.readKey({ armoredKey: publicKeyArmored }); const privateKey = await openpgp.decryptKey({ - privateKey: await openpgp.readKey({ armoredKey: privateKeyArmored }), + privateKey: await openpgp.readPrivateKey({ armoredKey: privateKeyArmored }), passphrase }); @@ -394,7 +394,7 @@ can `.pipe()` to a `Writable` stream, for example. const publicKey = await openpgp.readKey({ armoredKey: publicKeyArmored }); const privateKey = await openpgp.decryptKey({ - privateKey: await openpgp.readKey({ armoredKey: privateKeyArmored }), + privateKey: await openpgp.readPrivateKey({ armoredKey: privateKeyArmored }), passphrase }); @@ -508,7 +508,7 @@ Using the private key: const publicKey = await openpgp.readKey({ armoredKey: publicKeyArmored }); const privateKey = await openpgp.decryptKey({ - privateKey: await openpgp.readKey({ armoredKey: privateKeyArmored }), + privateKey: await openpgp.readPrivateKey({ armoredKey: privateKeyArmored }), passphrase }); @@ -551,7 +551,7 @@ Using the private key: const publicKey = await openpgp.readKey({ armoredKey: publicKeyArmored }); const privateKey = await openpgp.decryptKey({ - privateKey: await openpgp.readKey({ armoredKey: privateKeyArmored }), + privateKey: await openpgp.readPrivateKey({ armoredKey: privateKeyArmored }), passphrase }); @@ -601,7 +601,7 @@ Using the private key: const passphrase = `yourPassphrase`; // what the private key is encrypted with const privateKey = await openpgp.decryptKey({ - privateKey: await openpgp.readKey({ armoredKey: privateKeyArmored }), + privateKey: await openpgp.readPrivateKey({ armoredKey: privateKeyArmored }), passphrase });