signature

This commit is contained in:
nora 2024-08-22 21:07:57 +02:00
parent a52b6b37d7
commit 3f0b367c39
3 changed files with 16 additions and 1 deletions

View file

@ -14,3 +14,4 @@ tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
rpassword = "7.3.1"
sha2 = "0.10.8"
hex = "0.4.3"
pem = "3.0.4"

View file

@ -1,4 +1,4 @@
use std::path::PathBuf;
use std::{io::Write, path::PathBuf};
use clap::Parser;
use eyre::{bail, Context};
@ -97,6 +97,9 @@ async fn main() -> eyre::Result<()> {
};
let signature = agent.sign(&key.key_blob, &file, 0).await?;
let signature = pem::encode(&pem::Pem::new("SSH SIGNATURE", signature));
std::io::stdout().write_all(signature.as_bytes())?;
}
Subcommand::Lock => {
let passphrase =