Struct minisign_verify::PublicKey
source · [−]pub struct PublicKey { /* private fields */ }
Expand description
A Minisign public key
Implementations
sourceimpl<'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 StructuralEq for PublicKey
impl StructuralPartialEq for PublicKey
Auto Trait Implementations
impl RefUnwindSafe for PublicKey
impl Send for PublicKey
impl Sync for PublicKey
impl Unpin for PublicKey
impl UnwindSafe for PublicKey
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more