AtKeysPassphraseEnvelopeCodec class

Encodes/decodes the passphrase envelope that optionally wraps an atKeys document at rest:

{"content": "<base64 AES ciphertext>", "iv": "<base64, 16 bytes>",
 "hashingAlgoType": "argon2id"}

The AES key is derived by hashing the passphrase with hashingAlgoType. A JSON object is recognized as an envelope by the presence of its iv field (isEnvelope).

Constructors

AtKeysPassphraseEnvelopeCodec()
const

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

decode(Map<String, dynamic> json, {String? passPhrase}) Future<Map<String, dynamic>>
Decrypts a passphrase envelope back to the JSON object it wraps. Returns json unchanged when it is not an envelope.
encode(String plaintext, String passPhrase, {HashingAlgoType hashingAlgoType = HashingAlgoType.argon2id, HashParams? hashParams}) Future<String>
Encrypts plaintext with a key derived from passPhrase and returns the envelope as a JSON string.
isEnvelope(Map<String, dynamic> json) bool
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