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

Encrypted Private Key? #188

Open
ddzobov opened this issue Nov 26, 2020 · 1 comment
Open

Encrypted Private Key? #188

ddzobov opened this issue Nov 26, 2020 · 1 comment

Comments

@ddzobov
Copy link

ddzobov commented Nov 26, 2020

Can this library generate and work with encrypted private keys?

-----BEGIN ENCRYPTED PRIVATE KEY-----

@dejaime
Copy link

dejaime commented Nov 26, 2020

No, apparently not. Check this other issue .
You're probably better off using standard crypto anyway.

const crypto = require('crypto');
const MyEncryptedPrivKey = require('fs').readFileSync('./keys/enc_private.pem').toString();
const EncryptedData = [...];

let DecryptedData = crypto.privateDecrypt({
    key: MyEncryptedPrivKey,
    passphrase: "MY_PRIVATE_KEY_AWESOME_PASSWORD",
}, EncryptedData);

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

2 participants