Returns the public key in its canonical encoding.
This implements the following specs:
-
General encoding: https://tools.ietf.org/html/draft-ietf-curdle-pkix-04
-
Key encoding: https://tools.ietf.org/html/rfc8032
For keys in older formats, decoding and then re-encoding is sufficient to
migrate them to the canonical encoding.
Relevant spec quotes:
In the X.509 certificate, the subjectPublicKeyInfo field has the
SubjectPublicKeyInfo type, which has the following ASN.1 syntax:
SubjectPublicKeyInfo ::= SEQUENCE {
algorithm AlgorithmIdentifier,
subjectPublicKey BIT STRING
}
AlgorithmIdentifier ::= SEQUENCE {
algorithm OBJECT IDENTIFIER,
parameters ANY DEFINED BY algorithm OPTIONAL
}
For all of the OIDs, the parameters MUST be absent.
id-Ed25519 OBJECT IDENTIFIER ::= { 1 3 101 112 }