-
Notifications
You must be signed in to change notification settings - Fork 173
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
Crashes upon using a cert/key pair with passphrase, works without passphrase #123
Comments
i'm afraid that handling private keys with passphrase is something that is not implemented in as a workaround you can parse your key, decrypt it and pass the decrypted content to example: // if you don't have your private key in PEM format you can use some openssl command to have your private key in PEM, the file will still be encrypted just in different format
var decryptedKey = forge.pki.decryptRsaPrivateKey(fs.readFileSync('/path/to/your/keyinpemformat.pem').toString('ascii'), 'your-passphare-here');
var decryptedKeyBuffer = new Buffer(forge.pki.privateKeyToPem(decryptedKey), 'ascii')
// now, you can use `decryptedKeyBuffer` as the `signingKey` option in xml-crypto other things that you can do is use some |
@bjrmatos Thank you for your answer. The solution using On the other hand, using |
i was just leaving a note that node.js have a special API when dealing with keys with it was just a note for myself or other possible contributor, i will keep the issue open until i find the time to implement this (seems like it would not require much work) 😄 |
Duplicate of #45 |
I get this error:
PEM routines:PEM_do_header:bad password read
when trying to use a key/cert pair that uses a passphrase, but when I use ones without a passphrase, it works fine.
I am working in an environment that has a hard requirement of using a passphrase, so using ones without passphrases doesn't work for me.
Is this a problem with the module, or am I doing something wrong? (missing an option specifying the passphrase? I couldn't find this in the docs)
The text was updated successfully, but these errors were encountered: