[][src]Trait rfc_4226::Secret

pub trait Secret: AsRef<[u8]> { }

Shared secret.

As per RFC 4226, "each HOTP generator has a different and unique secret."

This trait enables abstraction over different types of secret. All secrets must be coerced to a byte string for hashing, so secrets must implement AsRef<[u8]>. This trait is implemented for [u8; n] for 16 ≤ n ≤ 32, drawing inspiration from libcore. It is also implemented for &str and String. Thus, any of these types may be used as secrets with no additional configuration.

Requirements

As per RFC 4226, the secret MUST be at least 128 bits (with a recommended length of 160 bits). If the secret is not at least this long, the functions in this crate will return errors.

Implementations on Foreign Types

impl Secret for String[src]

impl<'_> Secret for &'_ str[src]

impl<'_> Secret for &'_ [u8][src]

impl<'_> Secret for &'_ [u8; 16][src]

impl<'_> Secret for &'_ [u8; 17][src]

impl<'_> Secret for &'_ [u8; 18][src]

impl<'_> Secret for &'_ [u8; 19][src]

impl<'_> Secret for &'_ [u8; 20][src]

impl<'_> Secret for &'_ [u8; 21][src]

impl<'_> Secret for &'_ [u8; 22][src]

impl<'_> Secret for &'_ [u8; 23][src]

impl<'_> Secret for &'_ [u8; 24][src]

impl<'_> Secret for &'_ [u8; 25][src]

impl<'_> Secret for &'_ [u8; 26][src]

impl<'_> Secret for &'_ [u8; 27][src]

impl<'_> Secret for &'_ [u8; 28][src]

impl<'_> Secret for &'_ [u8; 29][src]

impl<'_> Secret for &'_ [u8; 30][src]

impl<'_> Secret for &'_ [u8; 31][src]

impl<'_> Secret for &'_ [u8; 32][src]

Loading content...

Implementors

Loading content...