pub struct PublicKey { /* private fields */ }Expand description
A Minisign public key
Implementations§
Source§impl<'a> PublicKey
impl<'a> PublicKey
Sourcepub fn from_base64(public_key_b64: &str) -> Result<Self, Error>
pub fn from_base64(public_key_b64: &str) -> Result<Self, Error>
Create a Minisign public key from a base64 string
Sourcepub fn decode(lines_str: &str) -> Result<Self, Error>
pub fn decode(lines_str: &str) -> Result<Self, Error>
Create a Minisign public key from a string, as in the minisign.pub
file
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 key from a file (such as the minisign.pub file)
Sourcepub fn untrusted_comment(&self) -> Option<&str>
pub fn untrusted_comment(&self) -> Option<&str>
Return the untrusted comment, if there is one
Sourcepub fn verify(
&self,
bin: &[u8],
signature: &Signature,
allow_legacy: bool,
) -> Result<(), Error>
pub fn verify( &self, bin: &[u8], signature: &Signature, allow_legacy: bool, ) -> Result<(), Error>
Verify that signature is a valid signature for bin using this public
key allow_legacy should only be set to true in order to support
signatures made by older versions of Minisign.
Sourcepub fn verify_stream(
&'a self,
signature: &'a Signature,
) -> Result<StreamVerifier<'_>, Error>
pub fn verify_stream( &'a self, signature: &'a Signature, ) -> Result<StreamVerifier<'_>, Error>
Sets up a stream verifier that can be use iteratively.
Trait Implementations§
impl Eq for PublicKey
impl StructuralPartialEq for PublicKey
Auto Trait Implementations§
impl Freeze for PublicKey
impl RefUnwindSafe for PublicKey
impl Send for PublicKey
impl Sync for PublicKey
impl Unpin for PublicKey
impl UnwindSafe for PublicKey
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