pub trait DerPublicKey: PublicKey + DerKey {
    // Provided methods
    fn marshal_to_der(&self) -> Vec<u8> { ... }
    fn parse_from_der(bytes: &[u8]) -> Result<Self, Error> { ... }
}
Expand description

A public key which can be encoded as a DER object.

Provided Methods§

source

fn marshal_to_der(&self) -> Vec<u8>

Marshals a public key in DER format.

marshal_to_der marshals a public key as a DER-encoded SubjectPublicKeyInfo structure as defined in RFC 5280.

source

fn parse_from_der(bytes: &[u8]) -> Result<Self, Error>

Parses a public key in DER format.

parse_from_der parses a public key from a DER-encoded SubjectPublicKeyInfo structure as defined in RFC 5280.

§Elliptic Curve Keys

For Elliptic Curve keys (EcPubKey), the curve itself is validated. If the curve is not known ahead of time, and any curve must be supported at runtime, use the EcPubKeyAnyCurve::parse_from_der function.

Object Safety§

This trait is not object safe.

Implementors§