-
Notifications
You must be signed in to change notification settings - Fork 47
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 in PKCS#8 format not supported #17
Comments
The whole point of the library is to support encrypted PKCS#8, but not all cipher algorithms are supported. Can you give an example of key that is not supported? |
@conradoplg since the library is called pkcs8, I assume it would support encrypted private key in PKCS#8 format.
Since it doesn't contain dek-info, the library will panic with a message "only PKCS #5 v2.0 supported" |
It does support PKCS#8... but just a subset of all possible ciphers and key derivation functions. PKCS#8 is just a container format. PKCS#5 specifies the mechanism to encrypt data with a password, and it's used by PKCS#8. Can you give the output of |
@conradoplg
|
Weird. The "only PKCS #5 v2.0 supported" error happens when the library can't parse the ASN.1 structure, but it looks OK to me... The only weird thing is that the "INTEGER" doesn't show the integer value, did you delete it? Is there anything after the last OCTET STRING you posted? Can you provide a sample key that you can post, that raises the same error? If you can't, can you provide |
@conradoplg yes, I deleted the INTEGER, And the OCTET STRING has something in the end, I only copied a block of the whole output.
|
@Fire1nRain sorry, I meant the |
@conradoplg Github doesn't support *.der, so I renamed it with a .txt |
The header is fine... OK, I just realized what could be happening. What exactly are you passing to |
From my initial testing for an internal tool I'm working on, the
However, the following command usually generated a key that causes an error in
In my case, the following error was generated:
I tested this by generating test keys using LibreSSL 2.6.5 and OpenSSL 1.0.2s on OSX (Homebrew). However, when running the above command using OpenSSL 1.1.1c it generates keys that work just fine because PKCS#5 v2.0 is the default on OpenSSL 1.1.x. Right now I don't have time to figure out a workaround other than routing incompatible private keys through the |
@dexxtreme yes, the library doesn't support PKCS#5 v1.5... In order to support it, it would need to support a bunch of insecure ciphers or just some of them. |
Encrypted private key in PKCS#8 format are not supported???
Only PKCS#5 format supported???
Is there any plan in adding the support?
The text was updated successfully, but these errors were encountered: