#[non_exhaustive]pub enum PasskiError {
Show 31 variants
UserIdTooShort,
Base64Decode(Error),
InvalidClientDataJson(Error),
CborDecode(Error<Error>),
CborEncode(Error<Error>),
MissingClientDataField(String),
InvalidClientDataType(String),
ClientDataTypeMismatch {
expected: ClientDataType,
got: ClientDataType,
},
ChallengeMismatch,
OriginMismatch {
expected: Vec<String>,
got: String,
},
CrossOriginNotAllowed,
InvalidAuthenticatorData,
RpIdHashMismatch,
UserNotPresent,
UserVerificationRequired,
InvalidBackupFlags,
CounterRegression,
NoAttestedCredentialData,
CredentialNotAllowed,
CredentialIdMismatch,
UnsupportedAlgorithm(i32),
SignatureVerificationFailed,
InvalidCoseKey(String),
InvalidAttestationObject(String),
UnsupportedAttestationFormat(String),
MissingAttStmtField(String),
InvalidAttestation(String),
InvalidCertificate(String),
InvalidCertificateChain(String),
UntrustedAttestation,
MissingAttestationChain,
}Expand description
Error type for Passki operations.
One variant per way a ceremony can fail, so callers can react to a specific
failure - a PasskiError::CounterRegression means something quite
different from a malformed request - without matching on message strings.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
UserIdTooShort
user_id passed to crate::Passki::start_passkey_registration was too short.
Base64Decode(Error)
Base64url decoding failed.
InvalidClientDataJson(Error)
Client data JSON could not be parsed.
CborDecode(Error<Error>)
CBOR decoding failed.
CborEncode(Error<Error>)
CBOR encoding failed.
MissingClientDataField(String)
A required field was missing from the client data JSON.
InvalidClientDataType(String)
The client data type field was not a recognized WebAuthn operation.
ClientDataTypeMismatch
The client data type did not match the expected operation.
ChallengeMismatch
The client data challenge did not match the one that was issued.
OriginMismatch
The client data origin did not match any of the relying party’s origins.
CrossOriginNotAllowed
The client data indicated a cross-origin iframe request.
InvalidAuthenticatorData
The authenticator data was truncated or otherwise malformed.
RpIdHashMismatch
The rpIdHash in the authenticator data did not match the relying party.
UserNotPresent
The UP (user present) flag was not set.
UserVerificationRequired
User verification was required but the UV flag was not set.
InvalidBackupFlags
The BS (backup state) flag was set without the BE (backup eligibility) flag, which the WebAuthn spec forbids.
CounterRegression
The signature counter did not increase, indicating a possible replay attack or a cloned authenticator.
NoAttestedCredentialData
The authenticator data did not contain attested credential data.
CredentialNotAllowed
The credential used for authentication was not in the allowed list.
CredentialIdMismatch
The credential ID reported by the client did not match the one in the attested credential data.
UnsupportedAlgorithm(i32)
The COSE algorithm identifier is not supported.
SignatureVerificationFailed
Signature verification failed.
InvalidCoseKey(String)
A COSE key was malformed or missing a required field.
InvalidAttestationObject(String)
The attestation object did not have the expected structure.
UnsupportedAttestationFormat(String)
The attestation format (fmt) is not supported.
MissingAttStmtField(String)
A required field was missing from the attestation statement.
InvalidAttestation(String)
The attestation statement failed a format-specific structural or signature check.
InvalidCertificate(String)
The attestation certificate was malformed or did not satisfy the WebAuthn attestation certificate requirements.
InvalidCertificateChain(String)
The certificate chain did not hold together: a broken signature link, an expired certificate, or an issuer that is not a CA.
UntrustedAttestation
The chain was well formed but did not reach any of the roots installed
with crate::Passki::with_attestation_trust.
MissingAttestationChain
AttestationTrustPolicy::Required is in effect but the authenticator
sent no attestation certificate to validate.
Trait Implementations§
Source§impl Debug for PasskiError
impl Debug for PasskiError
Source§impl Display for PasskiError
impl Display for PasskiError
Source§impl Error for PasskiError
impl Error for PasskiError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()