Skip to main content

Keys

Enum Keys 

Source
pub enum Keys<'a> {
    Embedded,
    Pinned(&'a str),
    Bare(&'a [u8]),
    One(&'a str, &'a [u8]),
    Map(&'a BTreeMap<String, Vec<u8>>),
    Resolver(&'a dyn Fn(&str) -> Option<Vec<u8>>),
}
Expand description

Where an issuer’s Ed25519 key comes from.

Variants§

§

Embedded

No key from the caller. A did:key issuer verifies under the key inside its DID only when a non-empty trusted-issuer set names it.

§

Pinned(&'a str)

No key from the caller, and the caller pins the issuer it expects (a self-attestation): a did:key issuer equal to this DID verifies under the key inside its DID. Any other issuer is refused.

§

Bare(&'a [u8])

A bare 32-byte key. Accepted only for a did:key issuer, and only when it equals the key inside the DID.

§

One(&'a str, &'a [u8])

One (did, key) entry: the key is trusted for that DID only.

§

Map(&'a BTreeMap<String, Vec<u8>>)

A map keyed by issuer DID.

§

Resolver(&'a dyn Fn(&str) -> Option<Vec<u8>>)

A resolver from DID to key (None means unknown).

Implementations§

Source§

impl<'a> Keys<'a>

Source

pub fn map_of<I, S, K>(entries: I) -> BTreeMap<String, Vec<u8>>
where I: IntoIterator<Item = (S, K)>, S: Into<String>, K: AsRef<[u8]>,

The map form of a key list given as (did, key) pairs.

Trait Implementations§

Source§

impl<'a> Clone for Keys<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for Keys<'a>

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Keys<'a>

§

impl<'a> !Send for Keys<'a>

§

impl<'a> !Sync for Keys<'a>

§

impl<'a> !UnwindSafe for Keys<'a>

§

impl<'a> Forget for Keys<'a>

§

impl<'a> Freeze for Keys<'a>
where &'a str: Freeze, &'a [u8]: Freeze, &'a BTreeMap<String, Vec<u8>>: Freeze, &'a dyn Fn(&str) -> Option<Vec<u8>>: Freeze,

§

impl<'a> Move for Keys<'a>

§

impl<'a> Unpin for Keys<'a>
where &'a str: Unpin, &'a [u8]: Unpin, &'a BTreeMap<String, Vec<u8>>: Unpin, &'a dyn Fn(&str) -> Option<Vec<u8>>: Unpin,

§

impl<'a> UnsafeUnpin for Keys<'a>
where &'a str: UnsafeUnpin, &'a [u8]: UnsafeUnpin, &'a BTreeMap<String, Vec<u8>>: UnsafeUnpin, &'a dyn Fn(&str) -> Option<Vec<u8>>: UnsafeUnpin,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.