pub struct PublicKey { /* private fields */ }Expand description
A Minisign public key
This struct represents a Minisign public key, which can be used to verify signatures. A public key can be created from a base64 string, read from a file, or parsed from a string in minisign.pub format.
The public key contains an Ed25519 key, a key ID for signature matching, and optionally an untrusted comment.
Implementations§
Source§impl PublicKey
impl PublicKey
Sourcepub fn from_base64(public_key_b64: &str) -> Result<PublicKey, Error>
pub fn from_base64(public_key_b64: &str) -> Result<PublicKey, Error>
Create a Minisign public key from a base64 string
Sourcepub fn decode(lines_str: &str) -> Result<PublicKey, Error>
pub fn decode(lines_str: &str) -> Result<PublicKey, Error>
Create a Minisign public key from a string, as in the minisign.pub
file
Sourcepub fn from_file<P>(path: P) -> Result<PublicKey, Error>
pub fn from_file<P>(path: P) -> Result<PublicKey, 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>(
&'a self,
signature: &'a Signature,
) -> Result<StreamVerifier<'a>, Error>
pub fn verify_stream<'a>( &'a self, signature: &'a Signature, ) -> Result<StreamVerifier<'a>, 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 Forget for PublicKey
impl Freeze for PublicKey
impl Move for PublicKey
impl RefUnwindSafe for PublicKey
impl Send for PublicKey
impl Sync for PublicKey
impl Unpin for PublicKey
impl UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.