Open tarcieri opened 4 months ago
If this was done it would be nice if the choice of v1 vs v2 was in some way configurable, since some highly opinionated software (notably ring
) require v2 PKCS8 encoding.
@randombit the pkcs8::KeypairBytes
type could still be used to serialize PKCS#8 v2 if desired, by leveraging the From<SigningKey>
impl.
It seems even the most recent versions of OpenSSL don't support PKCS#8 v2 which includes the public key in the resulting document in addition to the private key. See: https://github.com/RustCrypto/formats/issues/1349
From RFC8410 Section 7:
Concretely this would involve changing the PKCS#8 serializer to not include the public key, which would permit interop with OpenSSL.
In many ways this makes sense as the public key is easily computed from the private key via scalar multiplication.