Error extracting a Cert & Key from a .p12 file
Asked Answered
G

1

16

I'm trying to extract cert & key from a .p12 file. Running this command in OpenSSL:

openssl pkcs12 -info -in certificate.p12 -nodes

It prompts for a password, but after that I get this error:

Error outputting keys and certificates
1C400000:error:0308010C:digital envelope routines:inner_evp_generic_fetch:unsupported:crypto\evp\evp_fetch.c:373:Global default library context, Algorithm (RC2-40-CBC : 0), Properties ()

Does it sound like an issue with the OpenSSL version? I have version 3.0.7 installed on my Windows computer.

Thank you!

Grubman answered 19/1, 2023 at 16:34 Comment(5)
Does https://stackoverflow.com/questions/72859711/convert-an-old-style-p12-to-pem-unsupported-algorithm-rc2-40-cbc work?Prognostic
It did not. This is what I get: pkcs12: unable to load provider legacy Hint: use -provider-path option or OPENSSL_MODULES environment variable.Grubman
I'm guessing then you may be on v3 and you may have to install v1.Prognostic
This solution helped me. Shortly speaking: add -legacy option.Appositive
The OpenSSL pkcs12 command with the -legacy option generates a PKCS#12 file using "legacy" encryption algorithms, such as RC2 and MD5. These encryption algorithms are considered insecure by modern cryptographic standards.Redbud
P
7

Add -legacy

Example: openssl pkcs12 -info -in certificate.p12 -legacy -nodes

Prohibitionist answered 11/4 at 1:19 Comment(2)
Read the comments. "This is what I get: pkcs12: unable to load provider legacy".Caveman
Adding -legacy worked for meNochur

© 2022 - 2024 — McMap. All rights reserved.