Harness the power of signify(1) to sign arbitrary git objects
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

convert sign and verify into raw cmds

closes #2

+17 -10
+17 -10
src/main.rs
··· 19 19 20 20 #[derive(Subcommand)] 21 21 enum Action { 22 + /// Primitive signing and verification commands 23 + #[command(subcommand)] 24 + Raw(RawAction), 25 + /// Hash a key and return it 26 + Fingerprint { 27 + /// The path to the base64 encoded key to hash 28 + #[arg(short = 'k', long)] 29 + key: PathBuf, 30 + }, 31 + } 32 + 33 + #[derive(Subcommand)] 34 + enum RawAction { 22 35 /// Sign an arbitrary object and return a tree with the signature 23 36 Sign { 24 37 /// The path to the base64 encoded secret key to sign with ··· 41 54 /// The git tree containing a signed object 42 55 git_tree: String, 43 56 }, 44 - /// Hash a key and return it 45 - Fingerprint { 46 - /// The path to the base64 encoded key to hash 47 - #[arg(short = 'k', long)] 48 - key: PathBuf, 49 - }, 50 57 } 51 58 52 59 fn main() -> Result<()> { 53 60 let args = Args::parse(); 54 61 55 62 match args.action { 56 - Action::Sign { 63 + Action::Raw(RawAction::Sign { 57 64 secret_key, 58 65 git_rev: rev, 59 - } => sign::command(secret_key, rev), 60 - Action::Verify { 66 + }) => sign::command(secret_key, rev), 67 + Action::Raw(RawAction::Verify { 61 68 public_key, 62 69 print_signed_oid: recover, 63 70 git_tree: rev, 64 - } => verify::command(public_key, recover, rev), 71 + }) => verify::command(public_key, recover, rev), 65 72 Action::Fingerprint { key } => fingerprint::command(key), 66 73 } 67 74 }