PemUtils can parse PKCS#8 encrypted files, but only if the algorithm name in the PKCS8 info is a name supported by SecretKeyFactory
|
EncryptedPrivateKeyInfo encryptedPrivateKeyInfo = new EncryptedPrivateKeyInfo(keyBytes); |
|
SecretKeyFactory secretKeyFactory = SecretKeyFactory.getInstance(encryptedPrivateKeyInfo.getAlgName()); |
This works when using PBES1 but not for PBES2.
See: https://discuss.elastic.co/t/elasticsearch-certutil-http/286230/2
PemUtils can parse PKCS#8 encrypted files, but only if the algorithm name in the PKCS8 info is a name supported by
SecretKeyFactoryelasticsearch/libs/ssl-config/src/main/java/org/elasticsearch/common/ssl/PemUtils.java
Lines 368 to 369 in 1399fb6
This works when using PBES1 but not for PBES2.
See: https://discuss.elastic.co/t/elasticsearch-certutil-http/286230/2