Struct http_sig::SimpleKeyProvider
source · pub struct SimpleKeyProvider { /* private fields */ }
Expand description
Implementation of a simple key store.
Can store multiple keys with the same Key ID but different algorithms. If no algorithm is specified in the request, the first key added for that Key ID will be used.
Implementations§
source§impl SimpleKeyProvider
impl SimpleKeyProvider
sourcepub fn new<I, S, K>(key_iter: I) -> Selfwhere
I: IntoIterator<Item = (S, K)>,
S: Into<String>,
K: Into<Arc<dyn HttpSignatureVerify>>,
pub fn new<I, S, K>(key_iter: I) -> Selfwhere I: IntoIterator<Item = (S, K)>, S: Into<String>, K: Into<Arc<dyn HttpSignatureVerify>>,
Initializes the key store from a list of key IDs and signature algorithms.
sourcepub fn add(&mut self, key_id: &str, key: Arc<dyn HttpSignatureVerify>)
pub fn add(&mut self, key_id: &str, key: Arc<dyn HttpSignatureVerify>)
Adds a key to the key store
sourcepub fn remove_all(&mut self, key_id: &str)
pub fn remove_all(&mut self, key_id: &str)
Removes all keys with the specified Key ID from the key store
Trait Implementations§
source§impl Clone for SimpleKeyProvider
impl Clone for SimpleKeyProvider
source§fn clone(&self) -> SimpleKeyProvider
fn clone(&self) -> SimpleKeyProvider
Returns a copy 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 SimpleKeyProvider
impl Debug for SimpleKeyProvider
source§impl Default for SimpleKeyProvider
impl Default for SimpleKeyProvider
source§fn default() -> SimpleKeyProvider
fn default() -> SimpleKeyProvider
Returns the “default value” for a type. Read more
source§impl KeyProvider for SimpleKeyProvider
impl KeyProvider for SimpleKeyProvider
source§fn provide_keys(&self, key_id: &str) -> Vec<Arc<dyn HttpSignatureVerify>>
fn provide_keys(&self, key_id: &str) -> Vec<Arc<dyn HttpSignatureVerify>>
Given the name of an algorithm (eg.
hmac-sha256
) and the key ID, return a set
of possible keys and algorithms. Returns an empty Vec if no appropriate key/algorithm
combination could be found.Auto Trait Implementations§
impl !RefUnwindSafe for SimpleKeyProvider
impl Send for SimpleKeyProvider
impl Sync for SimpleKeyProvider
impl Unpin for SimpleKeyProvider
impl !UnwindSafe for SimpleKeyProvider
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