Trait quinn::crypto::HmacKey[][src]

pub trait HmacKey: Send + Sync {
    type Signature: AsRef<[u8]>;

    pub const KEY_LEN: usize;

    pub fn new(key: &[u8]) -> Result<Self, ConfigError>;
pub fn sign(&self, data: &[u8]) -> Self::Signature;
pub fn verify(
        &self,
        data: &[u8],
        signature: &[u8]
    ) -> Result<(), CryptoError>; }

A key for signing with HMAC-based algorithms

Associated Types

type Signature: AsRef<[u8]>[src]

Type of the signatures created by sign()

Loading content...

Associated Constants

pub const KEY_LEN: usize[src]

Length of the key input

Loading content...

Required methods

pub fn new(key: &[u8]) -> Result<Self, ConfigError>[src]

Method for creating a key

pub fn sign(&self, data: &[u8]) -> Self::Signature[src]

Method for signing a message

pub fn verify(&self, data: &[u8], signature: &[u8]) -> Result<(), CryptoError>[src]

Method for verifying a message

Loading content...

Implementations on Foreign Types

impl HmacKey for Key[src]

type Signature = Tag

Loading content...

Implementors

Loading content...