FlutterCipherMixin mixin
- Implemented types
-
- Mixin applications
-
Methods
-
checkParameters({int? length, required SecretKey secretKey, required int nonceLength, int aadLength = 0, int keyStreamIndex = 0})
→ void
-
Checks parameters for
encrypt
/ decrypt
and throws ArgumentError if
any is invalid.
inherited
-
cipherTextLength(int clearTextLength)
→ int
-
Calculates the length of the ciphertext given a clear text length.
-
decrypt(SecretBox secretBox, {required SecretKey secretKey, List<int> aad = const <int>[], int keyStreamIndex = 0, Uint8List? possibleBuffer})
→ Future<List<int>>
-
Decrypts a ciphertext.
-
decryptStream(Stream<List<int>> stream, {required SecretKey secretKey, required List<int> nonce, required FutureOr<Mac> mac, List<int> aad = const [], bool allowUseSameBytes = false})
→ Stream<List<int>>
-
Decrypts a Stream of bytes.
-
decryptString(SecretBox secretBox, {required SecretKey secretKey})
→ Future<String>
-
Calls
decrypt
and then converts the bytes to a string by using
utf8 codec.
inherited
-
encrypt(List<int> clearText, {required SecretKey secretKey, List<int>? nonce, List<int> aad = const <int>[], int keyStreamIndex = 0, Uint8List? possibleBuffer})
→ Future<SecretBox>
-
Encrypts a cleartext.
-
encryptStream(Stream<List<int>> stream, {required SecretKey secretKey, required List<int> nonce, required void onMac(Mac mac), List<int> aad = const [], bool allowUseSameBytes = false})
→ Stream<List<int>>
-
Encrypts a Stream of bytes.
-
encryptString(String clearText, {required SecretKey secretKey})
→ Future<SecretBox>
-
Converts a string to bytes using utf8 codec and then calls
encrypt
.
inherited
-
newCipherWand()
→ Future<CipherWand>
-
Constructs a
CipherWand
that uses this implementation and a new random
secret key (that can't be extracted).
inherited
-
newCipherWandFromSecretKey(SecretKey secretKey, {bool allowEncrypt = true, bool allowDecrypt = true})
→ Future<CipherWand>
-
Constructs a
CipherWand
that uses this implementation and the
given SecretKey
.
inherited
-
newNonce()
→ List<int>
-
Generates a new nonce.
inherited
-
newSecretKey()
→ Future<SecretKey>
-
Generates a new
SecretKey
.
inherited
-
newSecretKeyFromBytes(List<int> bytes)
→ Future<SecretKey>
-
Constructs a new
SecretKey
from the bytes.
inherited
-
newState()
→ CipherState
-
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
toString()
→ String
-
A string representation of this object.
inherited
-
toSync()
→ DartCipher
-
Returns a synchronous, pure Dart implementation of this cipher.
inherited