KeyRing

Struct KeyRing 

Source
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

Source

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.

Source

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.

Source

pub fn get(&self, identifier: &String) -> Option<&(Algorithm, Vec<u8>)>

Retrieve a key. Semantics are identical to HashMap::get.

Source

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

Source

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§

Source§

impl Clone for KeyRing

Source§

fn clone(&self) -> KeyRing

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for KeyRing

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for KeyRing

Source§

fn default() -> KeyRing

Returns the “default value” for a type. Read more
Source§

impl FromIterator<(String, (Algorithm, Vec<u8>))> for KeyRing

Source§

fn from_iter<T: IntoIterator<Item = (String, (Algorithm, PublicKey))>>( iter: T, ) -> KeyRing

Creates a value from an iterator. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.