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§
Sourcefn accept_certificate(&self, der: &[u8]) -> Result<PeerId, PeerError>
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.
Sourcefn record_waiting_certificate(&self, der: &[u8], source: Option<SocketAddr>)
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.
Sourcefn accept_public_key(&self, spki: &[u8]) -> Result<PeerId, PeerError>
fn accept_public_key(&self, spki: &[u8]) -> Result<PeerId, PeerError>
Accepts a raw public key (a DER SubjectPublicKeyInfo) directly, without it having
waited.
§Errors
Sourcefn record_waiting_public_key(&self, spki: &[u8], source: Option<SocketAddr>)
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".