Struct thrussh_keys::agent::client::AgentClient
source · pub struct AgentClient<S: AsyncRead + AsyncWrite> { /* private fields */ }
Expand description
SSH agent client.
Implementations§
source§impl<S: AsyncRead + AsyncWrite> AgentClient<S>
impl<S: AsyncRead + AsyncWrite> AgentClient<S>
sourcepub fn connect(stream: S) -> AgentClient<S>
pub fn connect(stream: S) -> AgentClient<S>
Build a future that connects to an SSH agent via the provided stream (on Unix, usually a Unix-domain socket).
sourcepub fn add_identity(
self,
key: &KeyPair,
constraints: &[Constraint]
) -> ReadResponse<S>
pub fn add_identity(
self,
key: &KeyPair,
constraints: &[Constraint]
) -> ReadResponse<S>
Send a key to the agent, with a (possibly empty) slice of constraints to apply when using the key to sign.
sourcepub fn add_smartcard_key(
self,
id: &str,
pin: &[u8],
constraints: &[Constraint]
) -> ReadResponse<S>
pub fn add_smartcard_key(
self,
id: &str,
pin: &[u8],
constraints: &[Constraint]
) -> ReadResponse<S>
Add a smart card to the agent, with a (possibly empty) set of constraints to apply when signing.
sourcepub fn lock(self, passphrase: &[u8]) -> ReadResponse<S>
pub fn lock(self, passphrase: &[u8]) -> ReadResponse<S>
Lock the agent, making it refuse to sign until unlocked.
sourcepub fn unlock(self, passphrase: &[u8]) -> ReadResponse<S>
pub fn unlock(self, passphrase: &[u8]) -> ReadResponse<S>
Unlock the agent, allowing it to sign again.
sourcepub fn request_identities(self) -> RequestIdentities<S>
pub fn request_identities(self) -> RequestIdentities<S>
Ask the agent for a list of the currently registered secret keys.
sourcepub fn sign_request(self, public: &PublicKey, data: &[u8]) -> SignRequest<S>
pub fn sign_request(self, public: &PublicKey, data: &[u8]) -> SignRequest<S>
Ask the agent to sign the supplied piece of data.
sourcepub fn remove_identity(self, public: &PublicKey) -> ReadResponse<S>
pub fn remove_identity(self, public: &PublicKey) -> ReadResponse<S>
Ask the agent to remove a key from its memory.
sourcepub fn remove_smartcard_key(self, id: &str, pin: &[u8]) -> ReadResponse<S>
pub fn remove_smartcard_key(self, id: &str, pin: &[u8]) -> ReadResponse<S>
Ask the agent to remove a smartcard from its memory.
sourcepub fn remove_all_identities(self) -> ReadResponse<S>
pub fn remove_all_identities(self) -> ReadResponse<S>
Ask the agent to forget all known keys.
sourcepub fn extension(self, typ: &[u8], ext: &[u8]) -> ReadResponse<S>
pub fn extension(self, typ: &[u8], ext: &[u8]) -> ReadResponse<S>
Send a custom message to the agent.
sourcepub fn query_extension(self, typ: &[u8], ext: CryptoVec) -> QueryExtension<S>
pub fn query_extension(self, typ: &[u8], ext: CryptoVec) -> QueryExtension<S>
Ask the agent what extensions about supported extensions.