pub struct Agent { /* private fields */ }Expand description
A structure representing a connection to an SSH agent.
Agents can be used to authenticate a session.
Implementations§
Source§impl Agent
impl Agent
Sourcepub fn disconnect(&mut self) -> Result<(), Error>
pub fn disconnect(&mut self) -> Result<(), Error>
Close a connection to an ssh-agent.
Sourcepub fn list_identities(&mut self) -> Result<(), Error>
pub fn list_identities(&mut self) -> Result<(), Error>
Request an ssh-agent to list of public keys, and stores them in the internal collection of the handle.
Call identities to get the public keys.
Sourcepub fn identities(&self) -> Result<Vec<PublicKey>, Error>
pub fn identities(&self) -> Result<Vec<PublicKey>, Error>
Get list of the identities of this agent.
Sourcepub fn userauth(
&self,
username: &str,
identity: &PublicKey,
) -> Result<(), Error>
pub fn userauth( &self, username: &str, identity: &PublicKey, ) -> Result<(), Error>
Attempt public key authentication with the help of ssh-agent.
Sourcepub fn set_identity_path(&mut self, path: &Path) -> Result<(), Error>
pub fn set_identity_path(&mut self, path: &Path) -> Result<(), Error>
Set a custom agent socket path to connect to.
Sourcepub fn identity_path(&self) -> Option<PathBuf>
pub fn identity_path(&self) -> Option<PathBuf>
Get the custom agent socket path, if set.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Agent
impl !UnwindSafe for Agent
impl Freeze for Agent
impl Unpin for Agent
impl UnsafeUnpin for Agent
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