Struct minisign_verify::PublicKey
source · 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)