AttestationMode enum

How createKeys treats CreateKeysConfig.attestationChallenge when the key cannot be attested.

Every mode fails with BiometricError.invalidInput for an empty or over-long challenge, except disabled, which ignores the challenge. When a mode falls back, the key is created without attestation in the same call (no second prompt), and KeyCreationResult.attestationErrorCode says why.

Falling back only changes what the client returns: your server must still decide whether an unattested key is acceptable.

More modes may be added in minor releases, so avoid exhaustive switches over this enum.

Inheritance
Available extensions

Values

enforceOnChallenge → const AttestationMode

Fail whenever a challenge is provided and the key cannot be attested. The default.

enforceOnChallengeIfSupported → const AttestationMode

Fall back to an unattested key when the device or platform cannot attest keys (BiometricError.notSupported), but fail on transient keystore failures (BiometricError.notAvailable).

Transient failures are only detected on Android 13+. Android 7–12 report every attestation failure as unsupported, so this mode falls back there.

preferred → const AttestationMode

Fall back to an unattested key on any attestation failure, transient ones included.

disabled → const AttestationMode

Ignore the challenge and create an unattested key, e.g. to switch attestation off remotely without changing call sites.

Properties

hashCode → int
The hash code for this object.
no setterinherited
index → int
A numeric identifier for the enumerated value.
no setterinherited
name → String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

values → const List<AttestationMode>
A constant List of the values in this enum, in order of their declaration.