pub struct Client { /* private fields */ }
Expand description
A Client instance is an object that can be used to interact with an ssh-agent, typically using a Unix socket
Implementations§
Source§impl<'a> Client
impl<'a> Client
Sourcepub fn connect(path: &Path) -> Result<Client>
pub fn connect(path: &Path) -> Result<Client>
Constructs a Client connected to a unix socket referenced by path.
Sourcepub fn with_read_write(read_write: Box<dyn ReadWrite>) -> Client
pub fn with_read_write(read_write: Box<dyn ReadWrite>) -> Client
Construct a Client backed by an implementation of ReadWrite, mainly useful for testing.
Sourcepub fn list_identities(&mut self) -> Result<Vec<PublicKey>>
👎Deprecated: Use list_all_identities() instead
pub fn list_identities(&mut self) -> Result<Vec<PublicKey>>
List the identities that has been added to the connected ssh-agent. Identities that are not ssh public keys, particularly identities that corresponds to certs, are ignored
Sourcepub fn list_all_identities(&mut self) -> Result<Vec<Identity<'_>>>
pub fn list_all_identities(&mut self) -> Result<Vec<Identity<'_>>>
List the identities that have been added to the connected ssh-agent including certs.
Sourcepub fn add_identity(&mut self, key: &PrivateKey) -> Result<()>
pub fn add_identity(&mut self, key: &PrivateKey) -> Result<()>
Add an identity to the connected ssh-agent.
Sourcepub fn remove_identity(&mut self, key: &PrivateKey) -> Result<()>
pub fn remove_identity(&mut self, key: &PrivateKey) -> Result<()>
Remove an identity from the connected ssh-agent.
Sourcepub fn remove_all_identities(&mut self) -> Result<()>
pub fn remove_all_identities(&mut self) -> Result<()>
Remove all identities from the connected ssh-agent.
Sourcepub fn sign(
&mut self,
key: impl Into<Identity<'a>>,
data: &[u8],
) -> Result<Signature>
pub fn sign( &mut self, key: impl Into<Identity<'a>>, data: &[u8], ) -> Result<Signature>
Instruct the connected ssh-agent to sign data with the private key associated with the provided public key. For now, sign requests with RSA keys are hard coded to use the SHA-512 hashing algorithm.