pub struct Keyring { /* private fields */ }Implementations§
Source§impl Keyring
impl Keyring
pub fn new(dir: impl Into<PathBuf>) -> Self
pub fn enroll( &mut self, account: &str, human: &HumanKey, ) -> Result<(), SignerError>
pub fn unlock( &mut self, account: &str, human: &HumanKey, ) -> Result<(), SignerError>
Sourcepub fn exists(&self, account: &str) -> bool
pub fn exists(&self, account: &str) -> bool
Whether account already has a sealed branch on disk.
Sourcepub fn take_nodes(&mut self, account: &str, nodes: &[String]) -> Vec<String>
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.
pub fn lock(&mut self, account: &str)
pub fn is_unlocked(&self, account: &str) -> bool
pub fn branch(&mut self, account: &str) -> Result<&mut Signer, SignerError>
Sourcepub fn account_of(token: &str) -> Result<String, SignerError>
pub fn account_of(token: &str) -> Result<String, SignerError>
Account named inside a token (unverified, routing only).
pub fn account_for_node(&self, node: &str) -> Option<String>
pub fn sign_from_node( &self, node: &str, token: &str, op: &str, payload: &[u8], ) -> Result<Signature, SignerError>
pub fn sign( &self, token: &str, op: &str, payload: &[u8], ) -> Result<Signature, SignerError>
pub fn m4a_vault_key( &self, node: &str, token: &str, ) -> Result<Zeroizing<[u8; 32]>, SignerError>
pub fn sign_m4a_keyproof( &self, node: &str, token: &str, message: &[u8], ) -> Result<Signature, SignerError>
pub fn delegate( &self, token: &str, transport: &str, ) -> Result<String, SignerError>
pub fn provision( &mut self, account: &str, node: &str, provider: &str, session: &str, rights: BTreeSet<String>, human: Option<&HumanKey>, ) -> Result<Provisioned, SignerError>
pub fn public_key_of( &self, account: &str, session: &str, ) -> Result<[u8; 32], SignerError>
Auto Trait Implementations§
impl Freeze for Keyring
impl RefUnwindSafe for Keyring
impl Send for Keyring
impl Sync for Keyring
impl Unpin for Keyring
impl UnsafeUnpin 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