diff --git a/src/certificate_store.rs b/src/certificate_store.rs index c258680..8123279 100644 --- a/src/certificate_store.rs +++ b/src/certificate_store.rs @@ -1,9 +1,14 @@ 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` and `std::collections::BTreeMap` 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; + /// Inserts a certificate fingerprint with the hostname as the key fn insert_certificate(&mut self, host: &str, fingerprint: &str) -> Option; + /// Returns true if a fingerprint has been stored for this host fn contains_certificate(&self, host: &str) -> bool; }