cipherbird_hardware library
Hardware-backed keys for CipherBird: a key that lives in the Secure Enclave (iOS, macOS) or the Android Keystore (StrongBox where the device has one, otherwise the trusted execution environment) wraps a keyring slot, optionally behind the system biometric prompt, and can be attested for a server. Flutter only; the browser and the pure Dart package have no key module.
final key = await HardwareKey.create('bank-possession', biometric: true);
final kr = CipherBird.instance.keyringCreate();
await CipherBird.instance.keyringAddHardwareSlot(kr, key);
final master = await CipherBird.instance.keyringUnlockWithHardware(kr, key);
Classes
- HardwareAttestation
- What the platform produced to attest a hardware key, for a server to verify. Nothing here is stored in the keyring envelope.
- HardwareBackend
-
The platform key module behind a hardware key. Every call may throw a
HardwareKeyException. - HardwareKey
-
A key held by the platform key module under a label. It wraps and
unwraps keyring factors; the key itself never leaves the module, and a
key created with create and
biometric: trueunwraps only after the user passes the system biometric prompt. - UnsupportedBackend
-
The backend on platforms without a key module: every call throws
unsupported, nothing falls back to a software key.
Enums
- AttestationKind
- The attestation scheme behind a HardwareAttestation.
- HardwareBacking
- Where a hardware key lives, as reported by the platform key module.
Extensions
- CipherBirdKeyringHardware on CipherBird
- Keyring slots wrapped by a HardwareKey.
Exceptions / Errors
- HardwareKeyException
-
A hardware key operation failed. code is stable across platforms:
unsupported,not_found,exists,authentication_failed,bad_argumentorfailed.