pub struct Signature { /* private fields */ }Expand description
A Minisign signature
This struct represents a Minisign signature, which contains:
- An untrusted comment (usually identifies the key that created the signature)
- The signature itself (Ed25519 signature of the message or its hash)
- A trusted comment (usually contains timestamp and filename)
- A global signature (Ed25519 signature of the signature and trusted comment)
- A flag indicating if the signature was created in pre-hashed mode
Pre-hashed mode is the default in newer versions of Minisign.
Implementations§
Source§impl Signature
impl Signature
Sourcepub fn decode(lines_str: &str) -> Result<Self, Error>
pub fn decode(lines_str: &str) -> Result<Self, Error>
Create a Minisign signature from a string
Sourcepub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self, Error>
pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self, Error>
Load a Minisign signature from a .sig file
Sourcepub fn trusted_comment(&self) -> &str
pub fn trusted_comment(&self) -> &str
Return the trusted comment of the signature
Sourcepub fn untrusted_comment(&self) -> &str
pub fn untrusted_comment(&self) -> &str
Return the untrusted comment of the signature
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Signature
impl RefUnwindSafe for Signature
impl Send for Signature
impl Sync for Signature
impl Unpin for Signature
impl UnsafeUnpin for Signature
impl UnwindSafe for Signature
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