#[cfg(any(feature = "fido-support", feature = "fido-support-mozilla"))]
pub mod generate;
#[derive(Debug)]
pub enum Error {
InvalidPin(Option<u8>),
PinRequired,
KeyLocked,
KeyBlocked,
CborFormat(String),
Unknown(String),
}
impl std::fmt::Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let msg = match self {
Self::InvalidPin(attempts) => {
if let Some(attempts) = attempts {
format!("Invalid pin: {} attempts remaining", attempts)
} else {
"Invalid pin".to_owned()
}
}
Self::PinRequired => String::from("Pin required for operation"),
Self::KeyLocked => String::from("Key locked"),
Self::KeyBlocked => String::from("Key blocked"),
Self::CborFormat(s) => s.to_string(),
Self::Unknown(s) => s.to_string(),
};
write!(f, "s{}", msg)
}
}
#[cfg(any(
feature = "fido-support",
feature = "fido-support-mozilla",
feature = "fido-lite"
))]
pub mod parsing;
#[cfg(any(feature = "fido-support", feature = "fido-support-mozilla"))]
mod utils;
#[cfg(any(feature = "fido-support", feature = "fido-support-mozilla"))]
pub use utils::*;
#[cfg(any(
feature = "fido-support",
feature = "fido-support-mozilla",
feature = "fido-lite"
))]
pub use parsing::{AuthData, CoseKey};
#[cfg(any(feature = "fido-support", feature = "fido-support-mozilla"))]
pub mod signing;
#[cfg(any(
feature = "fido-support",
feature = "fido-support-mozilla",
feature = "fido-lite"
))]
pub mod verification;
#[cfg(any(feature = "fido-support", feature = "fido-support-mozilla"))]
pub use generate::FIDOSSHKey;