Skip to content

PrivateKeyParser doesn't support ed448, XDH and RSA-PSS keys #37237

@mhalbritter

Description

@mhalbritter

Here's such a ed448 key:

-----BEGIN PRIVATE KEY-----
MEcCAQAwBQYDK2VxBDsEOSSF8O0uKk5pRrjUNV+QgonwO+WeDRb/i1U7vM+TLzh7
jAV58E6oglA53konKxGv+GC38dCb72gSeQ==
-----END PRIVATE KEY-----

(it has been generated with openssl genpkey -algorithm ed448 -out ed448.key and then converted to PKCS#8 with openssl pkcs8 -topk8 -in ed448.key -nocrypt -out ed448_2.key).

I guess the only change needed is to include Ed448 in these lines:

parsers.add(new PemParser(PKCS8_HEADER, PKCS8_FOOTER, PemPrivateKeyParser::createKeySpecForPkcs8, "RSA", "EC", "DSA", "Ed25519"));

parsers.add(new PemParser(PKCS8_ENCRYPTED_HEADER, PKCS8_ENCRYPTED_FOOTER, PemPrivateKeyParser::createKeySpecForPkcs8Encrypted, "RSA", "EC", "DSA", "Ed25519"));

and add tests for it.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions