pub struct KeyRing { /* private fields */ }
Expand description
A keyring that maps identifiers to public keys. Used in web-bot-auth to retrieve verifying keys for verificiation.
Implementations§
Source§impl KeyRing
impl KeyRing
Sourcepub fn import_raw(
&mut self,
identifier: String,
algorithm: Algorithm,
public_key: Vec<u8>,
) -> bool
pub fn import_raw( &mut self, identifier: String, algorithm: Algorithm, public_key: Vec<u8>, ) -> bool
Insert a raw public key under a known identifier. If an identifier is already known, it will not be updated and this method will return false.
Sourcepub fn rename_key(
&mut self,
old_identifier: String,
new_identifier: String,
) -> bool
pub fn rename_key( &mut self, old_identifier: String, new_identifier: String, ) -> bool
Rename a public key from old_identifier
to new_identifier
. Returns false
if the old
key was not present.
Sourcepub fn get(&self, identifier: &String) -> Option<&(Algorithm, Vec<u8>)>
pub fn get(&self, identifier: &String) -> Option<&(Algorithm, Vec<u8>)>
Retrieve a key. Semantics are identical to HashMap::get
.
Sourcepub fn try_import_jwk(
&mut self,
jwk: &Thumbprintable,
) -> Result<(), KeyringError>
pub fn try_import_jwk( &mut self, jwk: &Thumbprintable, ) -> Result<(), KeyringError>
Import a single JSON Web Key. This method is fallible.
§Errors
Unsupported keys will not be imported, as will keys that failed to be inserted
Sourcepub fn import_jwks(&mut self, jwks: JSONWebKeySet) -> Vec<Option<KeyringError>>
pub fn import_jwks(&mut self, jwks: JSONWebKeySet) -> Vec<Option<KeyringError>>
Import a JSON Web Key Set on a best-effort basis. This method returns a vector indicating whether or not the corresponding key in the key set could be imported.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KeyRing
impl RefUnwindSafe for KeyRing
impl Send for KeyRing
impl Sync for KeyRing
impl Unpin for KeyRing
impl UnwindSafe for KeyRing
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