Enum yubihsm::algorithm::HmacAlg [−][src]
#[repr(u8)]pub enum HmacAlg { SHA1, SHA256, SHA384, SHA512, }
Valid algorithms for HMAC keys
Variants
SHA1
hmac-sha1
SHA256
hmac-sha256
SHA384
hmac-sha384
SHA512
hmac-sha512
Methods
impl HmacAlg
[src]
impl HmacAlg
pub fn from_u8(tag: u8) -> Result<Self, AlgorithmError>
[src]
pub fn from_u8(tag: u8) -> Result<Self, AlgorithmError>
Convert an unsigned byte tag into an HmacAlgorithm
(if valid)
pub fn to_u8(self) -> u8
[src]
pub fn to_u8(self) -> u8
Serialize algorithm ID as a byte
pub fn key_len(self) -> usize
[src]
pub fn key_len(self) -> usize
Recommended key length (identical to output size)
pub fn max_key_len(self) -> usize
[src]
pub fn max_key_len(self) -> usize
Return the size of the given key (as expected by the YubiHSM2
) in bytes
Trait Implementations
impl Copy for HmacAlg
[src]
impl Copy for HmacAlg
impl Clone for HmacAlg
[src]
impl Clone for HmacAlg
fn clone(&self) -> HmacAlg
[src]
fn clone(&self) -> HmacAlg
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Debug for HmacAlg
[src]
impl Debug for HmacAlg
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Eq for HmacAlg
[src]
impl Eq for HmacAlg
impl PartialEq for HmacAlg
[src]
impl PartialEq for HmacAlg
fn eq(&self, other: &HmacAlg) -> bool
[src]
fn eq(&self, other: &HmacAlg) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]This method tests for !=
.
impl From<HmacAlg> for Algorithm
[src]
impl From<HmacAlg> for Algorithm
impl Serialize for HmacAlg
[src]
impl Serialize for HmacAlg
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>
[src]
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>
Serialize this value into the given Serde serializer. Read more
impl<'de> Deserialize<'de> for HmacAlg
[src]
impl<'de> Deserialize<'de> for HmacAlg
fn deserialize<D: Deserializer<'de>>(
deserializer: D
) -> Result<HmacAlg, D::Error>
[src]
fn deserialize<D: Deserializer<'de>>(
deserializer: D
) -> Result<HmacAlg, D::Error>
Deserialize this value from the given Serde deserializer. Read more