Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect example in README for asymmetric encryption #8

Open
bitsal opened this issue Jun 1, 2017 · 0 comments
Open

Incorrect example in README for asymmetric encryption #8

bitsal opened this issue Jun 1, 2017 · 0 comments

Comments

@bitsal
Copy link

bitsal commented Jun 1, 2017

Encryption
Current version

options = {
...  
    privateKeys: openpgp.readArmoredKey(privkey).keys, // for signing (optional)
...
};

but should be

options = {
  ...
  privateKeys: openpgp.readArmoredKey(privkey).keys
        .map(key =>  openpgp.decryptKey({
                          privateKey: key,
                          passphrase: <passphrase>
                  }).key
         )  // for signing (optional)
...
};

Decryption
Current version

options = {
...
  privateKey: openpgp.readArmoredKey(privkey).keys[0], // for decryption
...
};

but should be

options = {
  ...
  privateKey: openpgp.decryptKey({
                          privateKey: openpgp.readArmoredKey(privkey).keys[0],
                          passphrase: <passphrase>
                  }).key 
           // for decryption
...
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant