Enum yubihsm::algorithm::OtpAlg [−][src]
#[repr(u8)]pub enum OtpAlg { AES128, AES192, AES256, }
Valid algorithms for Yubico OTP (AES-based one time password) keys
Variants
AES128
Yubico OTP using AES-128
AES192
Yubico OTP using AES-192
AES256
Yubico OTP using AES-256
Methods
impl OtpAlg
[src]
impl OtpAlg
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 OtpAlgorithm
(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
Return the size of the given key (as expected by the YubiHSM2
) in bytes
Trait Implementations
impl Copy for OtpAlg
[src]
impl Copy for OtpAlg
impl Clone for OtpAlg
[src]
impl Clone for OtpAlg
fn clone(&self) -> OtpAlg
[src]
fn clone(&self) -> OtpAlg
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 OtpAlg
[src]
impl Debug for OtpAlg
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 OtpAlg
[src]
impl Eq for OtpAlg
impl PartialEq for OtpAlg
[src]
impl PartialEq for OtpAlg
fn eq(&self, other: &OtpAlg) -> bool
[src]
fn eq(&self, other: &OtpAlg) -> 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<OtpAlg> for Algorithm
[src]
impl From<OtpAlg> for Algorithm
impl Serialize for OtpAlg
[src]
impl Serialize for OtpAlg
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 OtpAlg
[src]
impl<'de> Deserialize<'de> for OtpAlg
fn deserialize<D: Deserializer<'de>>(
deserializer: D
) -> Result<OtpAlg, D::Error>
[src]
fn deserialize<D: Deserializer<'de>>(
deserializer: D
) -> Result<OtpAlg, D::Error>
Deserialize this value from the given Serde deserializer. Read more