Skip to main content

TrustStoreExt

Trait TrustStoreExt 

Source
pub trait TrustStoreExt {
    // Required methods
    fn accept_certificate(&self, der: &[u8]) -> Result<PeerId, PeerError>;
    fn record_waiting_certificate(&self, der: &[u8], source: Option<SocketAddr>);
    fn accept_public_key(&self, spki: &[u8]) -> Result<PeerId, PeerError>;
    fn record_waiting_public_key(&self, spki: &[u8], source: Option<SocketAddr>);
}
Expand description

Certificate-shaped access to a TrustStore.

Required Methods§

Source

fn accept_certificate(&self, der: &[u8]) -> Result<PeerId, PeerError>

Accepts a certificate directly, without it having waited.

§Errors

PeerError::Certificate when der is too large, PeerError::AlreadyAccepted, PeerError::Io on write failure.

Source

fn record_waiting_certificate(&self, der: &[u8], source: Option<SocketAddr>)

Records a turned-away peer’s certificate as waiting. Call it only after the peer proved it holds the certificate’s key, as the verifiers of this crate do.

Source

fn accept_public_key(&self, spki: &[u8]) -> Result<PeerId, PeerError>

Accepts a raw public key (a DER SubjectPublicKeyInfo) directly, without it having waited.

§Errors

As accept_certificate.

Source

fn record_waiting_public_key(&self, spki: &[u8], source: Option<SocketAddr>)

Records a turned-away peer’s raw public key as waiting. Call it only after the peer proved it holds the key, as the verifiers of this crate do.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§