pub struct Credential {
pub id: Vec<u8>,
pub public_key: PublicKey,
pub sign_count: u32,
pub user_id: Vec<u8>,
pub rp_id: String,
pub created_at: SystemTime,
pub backup_eligible: bool,
pub backup_state: bool,
}Expand description
A registered credential persisted on the relying-party side after a successful registration ceremony.
The caller is responsible for storing this in a durable, server-side store
keyed by id (the credential ID) and associated with user_id.
Fields§
§id: Vec<u8>Opaque byte string that uniquely identifies this credential. Produced by the authenticator during registration.
public_key: PublicKeyThe authenticator’s public key in the format signalled during registration.
sign_count: u32Monotonically increasing counter maintained by the authenticator. Used to detect cloned authenticators.
user_id: Vec<u8>Application-defined identifier for the user this credential belongs to.
rp_id: StringRelying party ID (e.g. "example.com").
Stored so authentication can verify the credential is bound to this RP.
created_at: SystemTimeWhen this credential was first registered.
backup_eligible: boolWhether this credential is eligible for backup to a platform sync service (BE flag, §6.1 bit 3).
This value is immutable per spec — the authenticator sets it once at
registration and it must not change in subsequent ceremonies. A change
in backup_eligible between registration and authentication is treated
as a credential substitution attempt and rejected with
crate::error::WebAuthnError::BackupEligibilityChanged.
backup_state: boolWhether this credential is currently backed up (BS flag, §6.1 bit 4).
This value may change between ceremonies as the user’s backup state
varies. After a successful authentication ceremony, update this field
to AuthenticationResult.backup_state before persisting the credential.
Trait Implementations§
Source§impl Clone for Credential
impl Clone for Credential
Source§fn clone(&self) -> Credential
fn clone(&self) -> Credential
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more