跳到主要内容

Key

特性 Key 

Source
pub trait Key: Send + Sync {
    // Required methods
    fn sign_concat(&self, first: &[u8], middle: &[&[u8]], last: &[u8]) -> Tag;
    fn tag_len(&self) -> usize;

    // Provided method
    fn sign(&self, data: &[&[u8]]) -> Tag { ... }
}
展开描述

A HMAC key , ready 用于 use.

此 算法 用 is implicit in the Hmac object that produced the key.

必需方法§

Source

fn sign_concat(&self, first: &[u8], middle: &[&[u8]], last: &[u8]) -> Tag

Calculates 一个 tag over the concatenation of first, the items in middle, 并 last

Source

fn tag_len(&self) -> usize

Returns the length of the tag returned by 一个 computation using this key.

提供方法§

Source

fn sign(&self, data: &[&[u8]]) -> Tag

Calculates 一个 tag over data – 一个 slice of byte slices.

实现者§