rustls::crypto::hmac

Trait Hmac

Source
pub trait Hmac: Send + Sync {
    // Required methods
    fn with_key(&self, key: &[u8]) -> Box<dyn Key>;
    fn hash_output_len(&self) -> usize;

    // Provided method
    fn fips(&self) -> bool { ... }
}
Expand description

A concrete HMAC implementation, for a single cryptographic hash function.

You should have one object that implements this trait for HMAC-SHA256, another for HMAC-SHA384, etc.

Required Methods§

Source

fn with_key(&self, key: &[u8]) -> Box<dyn Key>

Prepare to use key as a HMAC key.

Source

fn hash_output_len(&self) -> usize

Give the length of the underlying hash function. In RFC2104 terminology this is L.

Provided Methods§

Source

fn fips(&self) -> bool

Return true if this is backed by a FIPS-approved implementation.

Implementors§