Added docs for CertificateStore
This commit is contained in:
parent
799ff9ef17
commit
887ab8e085
1 changed files with 6 additions and 1 deletions
|
@ -1,9 +1,14 @@
|
||||||
use std::collections::{BTreeMap, HashMap};
|
use std::collections::{BTreeMap, HashMap};
|
||||||
|
|
||||||
/// An item which stores known certificates
|
/// An item which stores known certificates. For convenience, this trait is implemented for
|
||||||
|
/// `std::collections::HashMap<String, String>` and `std::collections::BTreeMap<String, String>`
|
||||||
pub trait CertificateStore: Send + Sync {
|
pub trait CertificateStore: Send + Sync {
|
||||||
|
/// Retrieves a certificate fingerprint using the hostname as it's key if
|
||||||
|
/// it has previously been saved
|
||||||
fn get_certificate(&self, host: &str) -> Option<String>;
|
fn get_certificate(&self, host: &str) -> Option<String>;
|
||||||
|
/// Inserts a certificate fingerprint with the hostname as the key
|
||||||
fn insert_certificate(&mut self, host: &str, fingerprint: &str) -> Option<String>;
|
fn insert_certificate(&mut self, host: &str, fingerprint: &str) -> Option<String>;
|
||||||
|
/// Returns true if a fingerprint has been stored for this host
|
||||||
fn contains_certificate(&self, host: &str) -> bool;
|
fn contains_certificate(&self, host: &str) -> bool;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue