Hello,
I have a PEM file on the device which can contain an
encrypted/non-encrypted private key. When it's encrypted, it's using
PBES/PBKDF. The file is accessed from a C++ application which uses the
OpenSSL library. If the key is encrypted, then it should be PKCS#8, but
checking it is PKCS#8 by using e.g. `PEM_read_PKCS8` is not enough to
confirm it is actually encrypted, since an unencrypted key can also be
stored as PKCS#8. Is there a way to check whether the key is encrypted
or not using OpenSSL APIs?
Best regards,
Bartlomiej Nowak