Struct thrussh_keys::agent::client::AgentClient[][src]

pub struct AgentClient<S: AsyncRead + AsyncWrite> { /* fields omitted */ }
Expand description

SSH agent client.

Implementations

impl<S: AsyncRead + AsyncWrite + Unpin> AgentClient<S>[src]

pub fn connect(stream: S) -> Self[src]

Build a future that connects to an SSH agent via the provided stream (on Unix, usually a Unix-domain socket).

impl AgentClient<UnixStream>[src]

pub async fn connect_uds<P: AsRef<Path>>(path: P) -> Result<Self, Error>[src]

Build a future that connects to an SSH agent via the provided stream (on Unix, usually a Unix-domain socket).

pub async fn connect_env() -> Result<Self, Error>[src]

Build a future that connects to an SSH agent via the provided stream (on Unix, usually a Unix-domain socket).

impl<S: AsyncRead + AsyncWrite + Unpin> AgentClient<S>[src]

pub async fn add_identity(
    &mut self,
    key: &KeyPair,
    constraints: &[Constraint]
) -> Result<(), Error>
[src]

Send a key to the agent, with a (possibly empty) slice of constraints to apply when using the key to sign.

pub async fn add_smartcard_key(
    &mut self,
    id: &str,
    pin: &[u8],
    constraints: &[Constraint]
) -> Result<(), Error>
[src]

Add a smart card to the agent, with a (possibly empty) set of constraints to apply when signing.

pub async fn lock(&mut self, passphrase: &[u8]) -> Result<(), Error>[src]

Lock the agent, making it refuse to sign until unlocked.

pub async fn unlock(&mut self, passphrase: &[u8]) -> Result<(), Error>[src]

Unlock the agent, allowing it to sign again.

pub async fn request_identities(&mut self) -> Result<Vec<PublicKey>, Error>[src]

Ask the agent for a list of the currently registered secret keys.

pub fn sign_request(
    self,
    public: &PublicKey,
    data: CryptoVec
) -> impl Future<Output = (Self, Result<CryptoVec, Error>)>
[src]

Ask the agent to sign the supplied piece of data.

pub fn sign_request_base64(
    self,
    public: &PublicKey,
    data: &[u8]
) -> impl Future<Output = (Self, Result<String, Error>)>
[src]

Ask the agent to sign the supplied piece of data.

pub fn sign_request_signature(
    self,
    public: &PublicKey,
    data: &[u8]
) -> impl Future<Output = Result<(Self, Signature), Error>>
[src]

Ask the agent to sign the supplied piece of data, and return a Signature.

pub async fn remove_identity(&mut self, public: &PublicKey) -> Result<(), Error>[src]

Ask the agent to remove a key from its memory.

pub async fn remove_smartcard_key(
    &mut self,
    id: &str,
    pin: &[u8]
) -> Result<(), Error>
[src]

Ask the agent to remove a smartcard from its memory.

pub async fn remove_all_identities(&mut self) -> Result<(), Error>[src]

Ask the agent to forget all known keys.

pub async fn extension(&mut self, typ: &[u8], ext: &[u8]) -> Result<(), Error>[src]

Send a custom message to the agent.

pub async fn query_extension(
    &mut self,
    typ: &[u8],
    ext: CryptoVec
) -> Result<bool, Error>
[src]

Ask the agent what extensions about supported extensions.

Auto Trait Implementations

impl<S> RefUnwindSafe for AgentClient<S> where
    S: RefUnwindSafe

impl<S> Send for AgentClient<S> where
    S: Send

impl<S> Sync for AgentClient<S> where
    S: Sync

impl<S> Unpin for AgentClient<S> where
    S: Unpin

impl<S> UnwindSafe for AgentClient<S> where
    S: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.