Skip to main content

PublicKeyData

Trait PublicKeyData 

pub trait PublicKeyData {
    // Required methods
    fn der_bytes(&self) -> &[u8] ;
    fn algorithm(&self) -> &'static SignatureAlgorithm;

    // Provided method
    fn subject_public_key_info(&self) -> Vec<u8>  { ... }
}
Available on crate feature rustls and (crate features aws-lc or ring) only.
Expand description

The public key data of a key pair

Required Methods§

fn der_bytes(&self) -> &[u8]

The public key in DER format

fn algorithm(&self) -> &'static SignatureAlgorithm

The algorithm used by the key pair

Provided Methods§

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

The public key data in DER format

The key is formatted according to the X.509 SubjectPublicKeyInfo struct. See RFC 5280 section 4.1.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

§

impl<K> PublicKeyData for &K
where K: PublicKeyData + ?Sized,

§

fn der_bytes(&self) -> &[u8]

§

fn algorithm(&self) -> &'static SignatureAlgorithm

Implementors§

§

impl PublicKeyData for KeyPair

Available on crate feature crypto only.
§

impl PublicKeyData for PublicKey

§

impl PublicKeyData for SubjectPublicKeyInfo