pub struct Signer { /* private fields */ }Expand description
Streaming DigestSign context.
Call update zero or more times, then finish to produce the signature.
Implementations§
Source§impl Signer
impl Signer
Sourcepub fn new(key: &Pkey<Private>, init: &SignInit<'_>) -> Result<Self, ErrorStack>
pub fn new(key: &Pkey<Private>, init: &SignInit<'_>) -> Result<Self, ErrorStack>
Create a signer.
§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 finish(&mut self) -> Result<Vec<u8>, ErrorStack>
pub fn finish(&mut self) -> Result<Vec<u8>, ErrorStack>
Finalise and return the signature.
Not supported by pure one-shot algorithms such as Ed25519 — use
sign_oneshot for those.
§Errors
Sourcepub fn sign_oneshot(&mut self, data: &[u8]) -> Result<Vec<u8>, ErrorStack>
pub fn sign_oneshot(&mut self, data: &[u8]) -> Result<Vec<u8>, ErrorStack>
One-shot sign over data.
Required for algorithms that do not support streaming (Ed25519, Ed448).
For algorithms that do support streaming, prefer update + finish.
§Errors
Auto Trait Implementations§
impl Freeze for Signer
impl RefUnwindSafe for Signer
impl Send for Signer
impl Sync for Signer
impl Unpin for Signer
impl UnsafeUnpin for Signer
impl UnwindSafe for Signer
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