HwKey class
A freshly generated hardware key handle.
Carries both what was requestedLevel and what was actually achieved (effectiveLevel) so a caller that asked for StrongBox but got the TEE can see both. The private key is non-exportable and never crosses this boundary.
Constructors
- HwKey({required String alias, required Jwk publicJwk, required String keyId, required KeySecurityLevel requestedLevel, required KeySecurityLevel effectiveLevel, required KeyAttestationType attestationType, required bool gatedByUserAuth, required UserAuthType userAuthType})
-
Creates a key handle. Normally produced by
AttestedSecureKeys.generateKey.const
Properties
- alias → String
-
The caller-chosen alias the key is stored under.
final
- attestationType → KeyAttestationType
-
The kind of attestation available for this key.
final
- effectiveLevel → KeySecurityLevel
-
The security level actually achieved.
final
- gatedByUserAuth → bool
-
Whether the OS will require user authentication to use the key.
final
- hasHardwareAttestation → bool
-
True when a server-verifiable proof of hardware origin is available.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isHardwareBacked → bool
-
True when the key lives in real secure hardware (StrongBox/TEE/SE).
no setter
- keyId → String
-
RFC 7638 JWK thumbprint (unpadded base64url) — a stable identifier.
final
- publicJwk → Jwk
-
The EC P-256 public key (RFC 7517).
final
- requestedLevel → KeySecurityLevel
-
The minimum security level the caller requested.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- userAuthType → UserAuthType
-
The kind of user authentication gating, if any.
final
Methods
-
copyWith(
{KeyAttestationType? attestationType, bool? gatedByUserAuth, UserAuthType? userAuthType}) → HwKey -
Returns a copy with the given fields replaced. Useful to fold the result
of a later
attest()orgetKeyInfo()back into a held handle. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited