about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tvix/nix-compat/src/narinfo/signature.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/tvix/nix-compat/src/narinfo/signature.rs b/tvix/nix-compat/src/narinfo/signature.rs
index a0e56f93488e..c7d2e1ecbcf7 100644
--- a/tvix/nix-compat/src/narinfo/signature.rs
+++ b/tvix/nix-compat/src/narinfo/signature.rs
@@ -4,11 +4,16 @@ use data_encoding::BASE64;
 
 #[derive(Debug)]
 pub struct Signature<'a> {
+    /// TODO(edef): be stricter with signature names here, they especially shouldn't have newlines!
     name: &'a str,
     bytes: [u8; 64],
 }
 
 impl<'a> Signature<'a> {
+    pub fn new(name: &'a str, bytes: [u8; 64]) -> Self {
+        Self { name, bytes }
+    }
+
     pub fn parse(input: &'a str) -> Result<Signature<'a>, SignatureError> {
         let (name, bytes64) = input
             .split_once(':')