跳到主要内容

Hmac

特性 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 { ... }
}
展开描述

A concrete HMAC implementation, 用于 一个 single cryptographic hash function.

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

必需方法§

Source

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

Prepare 到 use key as 一个 HMAC key.

Source

fn hash_output_len(&self) -> usize

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

提供方法§

Source

fn fips(&self) -> bool

Return true if this is 由 FIPS 批准的实现支持。

实现者§