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.

craft refs

+7 -1
+1 -1
src/sign.rs
··· 18 18 tree_sig.dereference()? 19 19 }; 20 20 let key_fingerprint = utils::hash_bytes(&secret_key.public().key()[..])?; 21 - let reference = format!("refs/signify/signatures/{key_fingerprint}/{signed_object}"); 21 + let reference = utils::craft_reference(key_fingerprint, signed_object); 22 22 repo.reference( 23 23 &reference, tree_oid, 24 24 // references to signatures will never change, so it is
+6
src/utils.rs
··· 156 156 ) 157 157 .context("Failed to open git repository") 158 158 } 159 + 160 + /// Craft a git reference to an object signed by a key with the given 161 + /// fingerprint. 162 + pub fn craft_reference(key_fingerprint: Oid, signed_object: Oid) -> String { 163 + format!("refs/signify/signatures/{key_fingerprint}/{signed_object}") 164 + }