pub struct CertPinStore { /* private fields */ }Expand description
Certificate pin store for multiple servers.
Implementations§
Source§impl CertPinStore
impl CertPinStore
Sourcepub fn add_pin(
&mut self,
server: impl Into<String>,
fingerprint: CertFingerprint,
)
pub fn add_pin( &mut self, server: impl Into<String>, fingerprint: CertFingerprint, )
Add a certificate pin for a server.
Multiple pins can be added for the same server (for certificate rotation).
Sourcepub fn add_pin_hex(
&mut self,
server: impl Into<String>,
hex: &str,
) -> Result<()>
pub fn add_pin_hex( &mut self, server: impl Into<String>, hex: &str, ) -> Result<()>
Add a certificate pin from hex string.
Sourcepub fn verify(&self, server: &str, cert_der: &[u8]) -> bool
pub fn verify(&self, server: &str, cert_der: &[u8]) -> bool
Check if a certificate is pinned for a server.
Sourcepub fn get_pins(&self, server: &str) -> Option<&[CertFingerprint]>
pub fn get_pins(&self, server: &str) -> Option<&[CertFingerprint]>
Get all pins for a server.
Sourcepub fn remove_pins(&mut self, server: &str)
pub fn remove_pins(&mut self, server: &str)
Remove all pins for a server.
Sourcepub fn server_count(&self) -> usize
pub fn server_count(&self) -> usize
Get the number of servers with pins.
Trait Implementations§
Source§impl Clone for CertPinStore
impl Clone for CertPinStore
Source§fn clone(&self) -> CertPinStore
fn clone(&self) -> CertPinStore
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CertPinStore
impl Debug for CertPinStore
Source§impl Default for CertPinStore
impl Default for CertPinStore
Source§fn default() -> CertPinStore
fn default() -> CertPinStore
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CertPinStore
impl RefUnwindSafe for CertPinStore
impl Send for CertPinStore
impl Sync for CertPinStore
impl Unpin for CertPinStore
impl UnwindSafe for CertPinStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more