pub struct CredentialPolicy {
pub user_verification: UserVerificationPolicy,
pub backup: BackupPolicy,
pub allowed_algorithms: Vec<i32>,
}Expand description
Per-ceremony credential policy: user verification, multi-device (backup) handling, and the registration algorithm allowlist.
Attach to crate::WebauthnConfig (credential_policy) and/or pass
directly to crate::verify_registration /
crate::protocol::AuthenticationParams::policy.
§Requirements
REQ-WA-142, REQ-WA-143, REQ-WA-144
Fields§
§user_verification: UserVerificationPolicyUser-verification requirement, enforced server-side
(default: UserVerificationPolicy::Preferred — report only).
backup: BackupPolicyMulti-device credential policy (default: BackupPolicy::Allow).
allowed_algorithms: Vec<i32>Registration-time COSE algorithm allowlist. An empty list accepts
every algorithm the kit can verify (default). A non-empty list
rejects registration of any credential whose algorithm is absent
with crate::WebauthnError::UnsupportedAlgorithm.
Implementations§
Source§impl CredentialPolicy
impl CredentialPolicy
Sourcepub fn strict() -> Self
pub fn strict() -> Self
Strict policy: UV required, device-bound credentials only, ES256 only.
Suitable for high-assurance flows (step-up, admin actions). Note that
RequireDeviceBound rejects synced passkeys outright — combined with
per-user registration, this limits credentials to hardware keys.