This commit is contained in:
nora 2024-08-22 21:17:51 +02:00
parent 3f0b367c39
commit 7ac2ef4194
4 changed files with 41 additions and 8 deletions

View file

@ -1,7 +0,0 @@
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
QyNTUxOQAAACDpK6HZbsijDttnop9lQyLLGXZi7lS5Hb3bY7DKMDC1vAAAAIhd37wfXd+8
HwAAAAtzc2gtZWQyNTUxOQAAACDpK6HZbsijDttnop9lQyLLGXZi7lS5Hb3bY7DKMDC1vA
AAAEBCev7X+rchYbMmzYfiyBzZhV/RaZZhYh+MR4/Ktcu0l+krodluyKMO22ein2VDIssZ
dmLuVLkdvdtjsMowMLW8AAAAA3V3dQEC
-----END OPENSSH PRIVATE KEY-----

View file

@ -1 +0,0 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOkrodluyKMO22ein2VDIssZdmLuVLkdvdtjsMowMLW8 uwu

View file

@ -13,6 +13,11 @@ struct Args {
#[derive(clap::Subcommand, Debug)]
enum Subcommand {
/// Add a new identity to the agent, SSH_AGENTC_ADD_IDENTITY
AddIdentity {
/// The path to the private key file
identity: PathBuf,
},
/// Remove all identities from the agent, SSH_AGENTC_REMOVE_ALL_IDENTITIES
RemoveAllIdentities,
/// List all identities in the agent, SSH_AGENTC_REQUEST_IDENTITIES
@ -46,6 +51,12 @@ async fn main() -> eyre::Result<()> {
let mut agent = ssh_agent_client::SocketAgentConnection::from_env().await?;
match args.command {
Subcommand::AddIdentity { identity } => {
let file = std::fs::read(&identity)
.wrap_err_with(|| format!("reading file {}", identity.display()))?;
let _ = file;
todo!("we need to parse and decrypt the key...")
}
Subcommand::RemoveAllIdentities => {
agent.remove_all_identities().await?;
println!("Removed all identities from the agent");