How to figure out if .P12 is RSA or ECC crypted

Viktor Dukhovni openssl-users at dukhovni.org
Thu Jun 9 12:40:21 UTC 2022


On Thu, Jun 09, 2022 at 10:16:24AM +0000, Beilharz, Michael wrote:

> I retrieve .P12 certificates, they can be RSA or ECC crypted

PKCS#12 objects are encrypted with a *symmetric* password: 3DES, AES,
...  Perhaps you're confusing the public key algorithm in the
certificate (or corresponding private key) with the encryption algorithm
of the PKCS#12 object?

> so I offer two methods, to convert them into .PEMs.

The extraction of PEM formatted (PKCS#8) private keys and certificate
chains (a sequence of X.509 certificate objects) from a PKCS#12 object
does not require any public key algorithm-dependent techniques.  The
same basic steps work for both RSA and ECDSA.

> I would like to detect, if a P12 is RSA or ECC crypted, so that I
> offer only one Method and the method itself decide the correct way to
> convert the P12.

What actual problem are you trying to solve?

-- 
    Viktor.


More information about the openssl-users mailing list