Skip to content

PemUtils fails to parse PKCS#8 private keys when using PBES2  #78901

Closed
@tvernum

Description

@tvernum

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions