diff --git a/tvix/nix-compat/src/narinfo/signature.rs b/tvix/nix-compat/src/narinfo/signature.rs index a0e56f934..c7d2e1ecb 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, SignatureError> { let (name, bytes64) = input .split_once(':')