pub struct Verifier { /* private fields */ }Expand description
Streaming DigestVerify context.
Implementations§
Source§impl Verifier
impl Verifier
Sourcepub fn new(key: &Pkey<Public>, init: &SignInit<'_>) -> Result<Self, ErrorStack>
pub fn new(key: &Pkey<Public>, init: &SignInit<'_>) -> Result<Self, ErrorStack>
Create a verifier.
§Errors
Sourcepub fn update(&mut self, data: &[u8]) -> Result<(), ErrorStack>
pub fn update(&mut self, data: &[u8]) -> Result<(), ErrorStack>
Feed data into the hash.
§Errors
Sourcepub fn verify(&mut self, signature: &[u8]) -> Result<bool, ErrorStack>
pub fn verify(&mut self, signature: &[u8]) -> Result<bool, ErrorStack>
Verify signature against all data fed via update.
Returns Ok(true) if valid, Ok(false) if the signature is incorrect,
or Err on a fatal OpenSSL error.
Not supported by pure one-shot algorithms such as Ed25519 — use
verify_oneshot for those.
§Errors
Sourcepub fn verify_oneshot(
&mut self,
data: &[u8],
signature: &[u8],
) -> Result<bool, ErrorStack>
pub fn verify_oneshot( &mut self, data: &[u8], signature: &[u8], ) -> Result<bool, ErrorStack>
One-shot verify signature over data.
Required for algorithms that do not support streaming (Ed25519, Ed448).
§Errors
Auto Trait Implementations§
impl Freeze for Verifier
impl RefUnwindSafe for Verifier
impl Send for Verifier
impl Sync for Verifier
impl Unpin for Verifier
impl UnsafeUnpin for Verifier
impl UnwindSafe for Verifier
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