Struct lhash::HmacKey [−][src]
pub struct HmacKey<D: Digest> { /* fields omitted */ }
Represents key used to sign content in hmac
algorithm.
Comparing to hmac
function it allows to pre-compute key and just sign input directly.
Digest
is only used in methods, making user to be responsible for using correct algorithm.
Implementations
impl<D: Digest> HmacKey<D>
[src]
pub fn new(secret: &[u8]) -> Self
[src]
Creates new hmac key, using provided secret.
If secret
size is above that of Digest::BlockType
then algorithm it is hashed,
reducing potential quality of hmac properties.
pub fn sign(&self, input: &[u8]) -> D::OutputType
[src]
Signs provided input
with the key.
Auto Trait Implementations
impl<D> Send for HmacKey<D> where
<D as Digest>::BlockType: Send,
<D as Digest>::BlockType: Send,
impl<D> Sync for HmacKey<D> where
<D as Digest>::BlockType: Sync,
<D as Digest>::BlockType: Sync,
impl<D> Unpin for HmacKey<D> where
<D as Digest>::BlockType: Unpin,
<D as Digest>::BlockType: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,