pub struct StorePathSignature {
pub key_name: String,
pub signature: Vec<u8>,
}Expand description
A parsed store path signature.
Fields§
§key_name: StringThe key name (e.g., “cache.nixos.org-1”).
signature: Vec<u8>The raw Ed25519 signature bytes (64 bytes).
Implementations§
Source§impl StorePathSignature
impl StorePathSignature
Sourcepub fn parse(s: &str) -> Result<Self, SignatureError>
pub fn parse(s: &str) -> Result<Self, SignatureError>
Parse a signature from the keyname:base64sig format.
Sourcepub fn to_string_repr(&self) -> String
pub fn to_string_repr(&self) -> String
Serialize to the keyname:base64sig format.
Sourcepub fn verify(
&self,
fingerprint: &str,
public_key: &[u8; 32],
) -> Result<(), SignatureError>
pub fn verify( &self, fingerprint: &str, public_key: &[u8; 32], ) -> Result<(), SignatureError>
Verify this signature against a fingerprint and public key.
Uses the default Ed25519 verifier. For custom verification strategies,
use verify_with() with a custom SignatureVerifier implementation.
Sourcepub fn verify_with(
&self,
fingerprint: &str,
public_key: &[u8],
verifier: &dyn SignatureVerifier,
) -> Result<(), SignatureError>
pub fn verify_with( &self, fingerprint: &str, public_key: &[u8], verifier: &dyn SignatureVerifier, ) -> Result<(), SignatureError>
Verify using a custom SignatureVerifier implementation.
Trait Implementations§
Source§impl Clone for StorePathSignature
impl Clone for StorePathSignature
Source§fn clone(&self) -> StorePathSignature
fn clone(&self) -> StorePathSignature
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StorePathSignature
impl Debug for StorePathSignature
Source§impl Display for StorePathSignature
impl Display for StorePathSignature
impl Eq for StorePathSignature
Source§impl PartialEq for StorePathSignature
impl PartialEq for StorePathSignature
Source§fn eq(&self, other: &StorePathSignature) -> bool
fn eq(&self, other: &StorePathSignature) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for StorePathSignature
Auto Trait Implementations§
impl Freeze for StorePathSignature
impl RefUnwindSafe for StorePathSignature
impl Send for StorePathSignature
impl Sync for StorePathSignature
impl Unpin for StorePathSignature
impl UnsafeUnpin for StorePathSignature
impl UnwindSafe for StorePathSignature
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more