TomAesGcmCacheCipher class

TomCacheCipher over AES-256-GCM.

A sealed file is nonce (12 bytes) ‖ ciphertext ‖ tag (16 bytes). The nonce is random per file; GCM's tag is what makes a file sealed under another key, or altered, fail to open rather than open as noise.

Implemented types

Constructors

TomAesGcmCacheCipher(Uint8List key, {Random? random})
A cipher over key, which must be 32 bytes.

Properties

hashCode → int
The hash code for this object.
no setterinherited
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
open(Uint8List sealed) → Future<Uint8List>
The bytes seal was given. Throws when sealed is not something this cipher sealed — a different key, a truncated file, a tampered one.
override
seal(Uint8List plain) → Future<Uint8List>
plain, sealed so that open returns it and nothing else does.
override
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

forDevice(TomCacheKeyStore secrets, {String handle = keyHandle, Random? random}) → Future<TomAesGcmCacheCipher>
The cipher for this device: over the key secrets holds under handle, minted first when it holds none.

Constants

keyHandle → const String
The default secret-store handle the cache key is kept under. A handle, not a secret.