pub struct WebauthnCredential {
pub credential_id: String,
pub public_key_cose: Vec<u8>,
pub sign_count: u32,
pub device_name: String,
pub registered_at: i64,
pub last_used_at: i64,
pub attestation_format: String,
pub user_verified: bool,
pub backup_eligible: bool,
pub backup_state: bool,
}Expand description
A registered WebAuthn credential.
The integrator persists one record per credential. WebauthnCredential::sign_count
is security-relevant state: after every successful
crate::verify_authentication, the caller must atomically persist
AuthenticationResult::new_sign_count (monotonic counter used for
authenticator-clone detection).
§Security note
public_key_cose is parsed and signature-checked on every authentication,
but the bytes stored at registration time should be treated as trusted
only because they were validated by crate::verify_registration before
persisting. Never accept a credential record whose provenance you cannot
establish.
Fields§
§credential_id: StringBase64url-encoded credential ID.
public_key_cose: Vec<u8>COSE public key bytes (CBOR-encoded).
sign_count: u32Counter to prevent replay/clone attacks. Persist the updated value
returned by crate::verify_authentication after each login.
device_name: StringHuman-readable device name (e.g. “YubiKey 5 NFC”).
registered_at: i64Registration timestamp (Unix seconds).
last_used_at: i64Last authentication timestamp (Unix seconds).
attestation_format: StringAttestation format (e.g. “none”, “packed”, “fido-u2f”, “android-key”).
Raw informational string; see the registration result’s
crate::attestation::AttestationResult for the verified trust
level.
user_verified: boolWhether user verification (biometrics/PIN) was performed at registration.
backup_eligible: boolBackup eligibility (BE) flag at registration: true when the
credential is a multi-device/syncable credential. Immutable for the
lifetime of the credential — persist and keep for policy decisions.
§Security note
BE=1 means account recovery follows the user’s cloud account rules,
not this credential’s confinement to one device. See
crate::policy::BackupPolicy for the trade-offs.
backup_state: boolBackup state (BS) flag at registration: whether the credential was
backed up at ceremony time. Volatile — superseded by the BS flag
reported on every AuthenticationResult.
Trait Implementations§
Source§impl Clone for WebauthnCredential
impl Clone for WebauthnCredential
Source§impl Debug for WebauthnCredential
impl Debug for WebauthnCredential
Source§impl<'de> Deserialize<'de> for WebauthnCredential
Available on crate feature serde only.
impl<'de> Deserialize<'de> for WebauthnCredential
serde only.