Skip to main content

Keyring

Struct Keyring 

Source
pub struct Keyring { /* private fields */ }

Implementations§

Source§

impl Keyring

Source

pub fn new(dir: impl Into<PathBuf>) -> Self

Source

pub fn enroll( &mut self, account: &str, human: &HumanKey, ) -> Result<(), SignerError>

Source

pub fn unlock( &mut self, account: &str, human: &HumanKey, ) -> Result<(), SignerError>

Source

pub fn exists(&self, account: &str) -> bool

Whether account already has a sealed branch on disk.

Source

pub fn take_nodes(&mut self, account: &str, nodes: &[String]) -> Vec<String>

Lock every other unlocked account that holds one of account’s nodes, so that node’s sessions get their identities from account alone. Returns the accounts locked.

Source

pub fn lock(&mut self, account: &str)

Source

pub fn is_unlocked(&self, account: &str) -> bool

Source

pub fn branch(&mut self, account: &str) -> Result<&mut Signer, SignerError>

Source

pub fn account_of(token: &str) -> Result<String, SignerError>

Account named inside a token (unverified, routing only).

Source

pub fn account_for_node(&self, node: &str) -> Option<String>

Source

pub fn sign_from_node( &self, node: &str, token: &str, op: &str, payload: &[u8], ) -> Result<Signature, SignerError>

Source

pub fn sign( &self, token: &str, op: &str, payload: &[u8], ) -> Result<Signature, SignerError>

Source

pub fn m4a_vault_key( &self, node: &str, token: &str, ) -> Result<Zeroizing<[u8; 32]>, SignerError>

Source

pub fn sign_m4a_keyproof( &self, node: &str, token: &str, message: &[u8], ) -> Result<Signature, SignerError>

Source

pub fn delegate( &self, token: &str, transport: &str, ) -> Result<String, SignerError>

Source

pub fn provision( &mut self, account: &str, node: &str, provider: &str, session: &str, rights: BTreeSet<String>, human: Option<&HumanKey>, ) -> Result<Provisioned, SignerError>

Source

pub fn public_key_of( &self, account: &str, session: &str, ) -> Result<[u8; 32], SignerError>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V