#ssh-agent #ssh-client #protocols #pure #interact

ssh-agent-client-rs

Pure rust implementation of the ssh-agent protocol. It can be used to write clients that interact with the ssh agent.

7 releases (breaking)

0.9.1 Feb 27, 2024
0.9.0 Oct 18, 2023
0.5.0 Jul 28, 2023
0.4.0 Jul 25, 2023
0.1.0 May 14, 2023

#625 in Network programming

Download history 10/week @ 2024-06-19 5/week @ 2024-06-26 43/week @ 2024-07-03 16/week @ 2024-07-10 56/week @ 2024-07-17 40/week @ 2024-07-24 10/week @ 2024-07-31 9/week @ 2024-08-07 3/week @ 2024-08-14 16/week @ 2024-08-21 95/week @ 2024-08-28 66/week @ 2024-09-04 76/week @ 2024-09-11 43/week @ 2024-09-18 70/week @ 2024-09-25 57/week @ 2024-10-02

250 downloads per month
Used in 6 crates (3 directly)

MIT/Apache

26KB
368 lines

ssh-agent-client-rs

build crates.io

ssh-agent-client-rs is a pure rust client library for interacting with an ssh-agent using the protocol defined in draft-miller-ssh-agent-04

The aim with the design of this library is to provide an easy-to-use and well tested library that can be used to perform the most common tasks interacting with the ssh-agent. The API will always be synchronous, as that corresponds to most use cases, and unless I get very bored at some point, it will probably not be a complete implementation of the protocol. However, contributions are more than welcome.

It was inspired by russh-agent but the projects does not share any code. In particular this client only exposes a synchronous API which simplifies both the implementation and interface.

Implemented and tested features

This client implements the most of the features described in the protocol specification, including the ability to instruct an ssh-agent to

  • add identities, the term the specification uses for a key pair, given a private key
  • list identities
  • remove an identity given a specific public key
  • remove all identities
  • sign an arbitrary message

The following features have not yet been implemented

  • adding identities with constraints
  • the dedicated message to add smartcard keys using the SSH_AGENTC_ADD_SMARTCARD_KEY message. However, in practice at least resident type smartcard keys from a device implementing FIDO2 such as Yubikey series 5 is added using the regular message to add an identity, SSH_AGENTC_ADD_IDENTITY

Usage

The example code in examples should be pretty easy to follow. The basic idea is to create a Client instance and call its public methods to interact with the ssh-agent.

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~8.5MB
~168K SLoC