pub mod credential;
pub mod index;
pub mod local;
pub mod pass;
#[cfg(feature = "tpm")]
pub mod tpm;
#[allow(unused_imports)]
pub(crate) use credential::Credential;
pub use local::LocalStorageAdapter;
pub use pass::PassStorageAdapter;
#[cfg(feature = "tpm")]
pub use tpm::TpmStorageAdapter;
use soft_fido2::Result;
#[derive(Debug, Clone)]
pub enum CredentialFilter {
None,
#[allow(dead_code)]
ById(Vec<u8>),
ByRp(String),
#[allow(dead_code)]
ByHash([u8; 32]),
}
pub trait CredentialStorage: Send + Sync {
fn read_first(&mut self, filter: CredentialFilter) -> Result<soft_fido2::Credential>;
fn read_next(&mut self) -> Result<soft_fido2::Credential>;
fn read(&mut self, id: &[u8]) -> Result<soft_fido2::Credential>;
fn write(&mut self, cred: soft_fido2::CredentialRef) -> Result<()>;
fn delete(&mut self, id: &[u8]) -> Result<()>;
fn count_credentials(&self) -> usize;
fn disable_user_verification(&self) -> bool {
false
}
fn cleanup_expired_cache(&mut self) {
}
}