Skip to content

4.2.2

@Spomky Spomky tagged this 26 Aug 10:50
Adds the "key:convert:pkcs8" command, the counterpart of "key:convert:pkcs1",
for the projects that share keys with libraries only able to import PKCS#8
private keys, such as the npm "jose" package.

RSA keys already had a PKCS#8 representation through RSAKey::toPEM(). EC keys
gain ECKey::convertPrivateKeyToPKCS8PEM(), which wraps the RFC 5915 ECPrivateKey
into a PrivateKeyInfo structure and supports every curve of the framework, the
Brainpool ones included. OKP keys gain the OKPKey utility and, with it, their
first JWK to PEM conversion.

As PKCS#8 only covers private keys, public keys are converted into a
SubjectPublicKeyInfo structure.

Closes #661
Assets 2
Loading