DeviceTrustClient class

Constructors

DeviceTrustClient(DeviceTrustTransport transport)

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
transport → DeviceTrustTransport
final

Methods

close() → void
createInstallationChallenge(String installationId) → Future<Map<String, dynamic>>
Asks for a key challenge: challenge_id and the payload to sign.
integrityChallenge({required String session, required InstallationIdentity identity, Map<String, dynamic>? operation}) → Future<ScanChallenge>
Asks for a scan under session: the installation's session, from verifyInstallation -- or, for a scan that approves one operation (describeOperation), your account session for this installation.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
proveAppPin({required String session, required InstallationIdentity identity, required String pin, required RequestProof request, String path = appPinProofPath}) → Future<RequestProof>
Has the backend check the app pin for the one signed request -- sent once, in a signed body, never in a header -- and answers that request unlocked by its proof, valid for that request alone.
registerInstallation(InstallationIdentity identity, ReinstallHint? hint, {StepUpKeyMetadata? stepUpKey, Map<String, dynamic> extra = const <String, dynamic>{}}) → Future<Map<String, dynamic>>
Registers the installation's key, and with stepUpKey the step-up key. The answer's installation_id is the installation your backend holds for this key, which may not be the one proposed. extra adds fields of your backend's own.
sendSigned(RequestProof proof, {String? method, String? path, String? encodedBody}) → Future<Map<String, dynamic>>
Sends proof's request. method, path and encodedBody replace what the proof was signed for -- only to test that a backend refuses them.
setAppPin({required String session, required InstallationIdentity identity, required String pin, Map<String, dynamic> reauthentication = const <String, dynamic>{}, String path = appPinPath}) → Future<Map<String, dynamic>>
Sets the account's app PIN under its account session. The backend requires the person's own re-authentication with it -- reauthentication carries it, the account's password for example: {'password': ...}.
signAndSend(String method, String path, {required String bearerToken, required InstallationIdentity identity, Map<String, dynamic>? body, String? installationId}) → Future<Map<String, dynamic>>
Signs and sends one request under bearerToken, its body as JSON. installationId replaces the installation the proof names, only to test that a backend refuses it.
submitIntegrityReport({required String session, required InstallationIdentity identity, required SignedReport report}) → Future<Map<String, dynamic>>
Sends report under the session that asked for its scan. The answer is your backend's own; for a scan that approves one request it carries report_id, sent with that request as X-Integrity-Report.
toString() → String
A string representation of this object.
inherited
verifyInstallation({required String installationId, required String challengeId, required String payload, required String signature}) → Future<Map<String, dynamic>>
Answers a key challenge; the answer carries device_token, your backend's session for this installation.

Operators

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

Constants

appPinPath → const String
The app PIN's default paths (the public guide, section 4).
appPinProofPath → const String
registrationFields → const Set<String>
The fields of the guide's registration, which registerInstallation's extra cannot replace.