pub struct Signer { /* private fields */ }Expand description
One account’s branch of the keystore (kept as Signer for 0.2.15 callers).
Implementations§
Source§impl Signer
impl Signer
pub fn init( path: impl Into<PathBuf>, human: &HumanKey, ) -> Result<Self, SignerError>
pub fn open(path: impl Into<PathBuf>) -> Self
pub fn is_unlocked(&self) -> bool
pub fn unlock(&mut self, human: &HumanKey) -> Result<(), SignerError>
pub fn lock(&mut self)
pub fn set_account(&mut self, account: &str) -> Result<(), SignerError>
pub fn account(&self) -> Result<String, SignerError>
pub fn register_node( &mut self, node: &str, human: &HumanKey, ) -> Result<(), SignerError>
Sourcepub fn provision(
&mut self,
node: &str,
provider: &str,
session: &str,
rights: BTreeSet<String>,
human: Option<&HumanKey>,
) -> Result<Provisioned, SignerError>
pub fn provision( &mut self, node: &str, provider: &str, session: &str, rights: BTreeSet<String>, human: Option<&HumanKey>, ) -> Result<Provisioned, SignerError>
New identity for a root session. Grants that need a human require the human key.
Sourcepub fn provision_child(
&mut self,
parent_token: &str,
node: &str,
provider: &str,
child_session: &str,
rights: BTreeSet<String>,
) -> Result<Provisioned, SignerError>
pub fn provision_child( &mut self, parent_token: &str, node: &str, provider: &str, child_session: &str, rights: BTreeSet<String>, ) -> Result<Provisioned, SignerError>
Child session: NEW identity, grants ⊆ parent’s, parent must hold spawn_child.
Sourcepub fn sign(
&self,
token: &str,
op: &str,
payload: &[u8],
) -> Result<Signature, SignerError>
pub fn sign( &self, token: &str, op: &str, payload: &[u8], ) -> Result<Signature, SignerError>
Sign payload as the token’s own nick.
Sourcepub fn delegate(
&self,
token: &str,
transport: &str,
) -> Result<String, SignerError>
pub fn delegate( &self, token: &str, transport: &str, ) -> Result<String, SignerError>
Attenuated copy of a session token for a consumer running inside hatchery: only the
grants of transport (e.g. “m4a”) that the token already holds. The consumer can verify
and use it but cannot widen it or mint siblings.
Sourcepub fn sign_m4a_keyproof(
&self,
node: &str,
token: &str,
message: &[u8],
) -> Result<Signature, SignerError>
pub fn sign_m4a_keyproof( &self, node: &str, token: &str, message: &[u8], ) -> Result<Signature, SignerError>
Sign an m4a key-proof statement (m4a-key-login-v1 / m4a-key-enroll-v1) with the
token’s own session key, so the session’s m4a account is proven by the same key that
never leaves the keystore. Any other message is refused: this cannot sign letters or
arbitrary bytes. The session must live on node.
Sourcepub fn m4a_vault_key(
&self,
node: &str,
token: &str,
) -> Result<Zeroizing<[u8; 32]>, SignerError>
pub fn m4a_vault_key( &self, node: &str, token: &str, ) -> Result<Zeroizing<[u8; 32]>, SignerError>
The 32-byte master key of this session’s m4a client vault (E2E device state, store keys), derived from the session’s keystore secret. Only the session’s own token on its own node gets it; another session’s vault cannot be opened with it.