[][src]Struct yaca::SignContext

pub struct SignContext { /* fields omitted */ }

Context for Sign operations

Implementations

impl SignContext[src]

pub fn initialize(algo: &DigestAlgorithm, prv_key: &Key) -> Result<SignContext>[src]

Initializes a signature context for asymmetric signatures

pub fn initialize_hmac(
    algo: &DigestAlgorithm,
    sym_key: &Key
) -> Result<SignContext>
[src]

Initializes a signature context for HMAC

  • algo is a digest algorithm that will be used.
  • sym_key is a key that will be used, supported key types:
  • For verification, calculate message HMAC and compare with received MAC using Yaca::memcmp().

pub fn initialize_cmac(
    algo: &EncryptAlgorithm,
    sym_key: &Key
) -> Result<SignContext>
[src]

Initializes a signature context for CMAC

  • algo is an encryption algorithm that will be used.
  • sym_key is a key that will be used, supported key types:
  • For verification, calculate message CMAC and compare with received MAC using Yaca::memcmp().

pub fn update(&self, message: &[u8]) -> Result<()>[src]

Feeds the message into the digital signature or MAC algorithm

  • message is a chunk of data to calculate signature or MAC from.

pub fn finalize(&self) -> Result<Vec<u8>>[src]

Calculates the final signature or MAC

  • Returns the calculated signature or MAC.
  • Skipping SignContext::update() and calling only SignContext::finalize() will produce a signature or MAC of an empty message.

Trait Implementations

impl ContextWithPadding for SignContext[src]

impl Drop for SignContext[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.