FlutterCryptography class

An implementation Cryptography that uses native operating system APIs.

Getting started

import 'package:cryptography_flutter/cryptography_flutter.dart' show FlutterCryptography;

void main() {
  // Enables use of Flutter cryptography.
  //
  // You can call this anywhere in your application, but we recommend the
  // main function.
  FlutterCryptography.enable();

  // ...
}

Constructors

FlutterCryptography({Random? random})

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

aesCbc({required MacAlgorithm macAlgorithm, PaddingAlgorithm paddingAlgorithm = PaddingAlgorithm.pkcs7, int secretKeyLength = 32}) → AesCbc
A factory used by AesCbc.
inherited
aesCtr({required MacAlgorithm macAlgorithm, int secretKeyLength = 32, int counterBits = AesCtr.defaultCounterBits}) → AesCtr
A factory used by AesCtr.
inherited
aesGcm({int secretKeyLength = 32, int nonceLength = AesGcm.defaultNonceLength}) → AesGcm
A factory used by AesGcm.
argon2id({required int memory, required int parallelism, required int iterations, required int hashLength}) → Argon2id
A factory used by Argon2id.
inherited
blake2b({int hashLengthInBytes = 64}) → Blake2b
A factory used by Blake2b.
inherited
blake2s({int hashLengthInBytes = 32}) → Blake2s
A factory used by Blake2s.
inherited
chacha20({required MacAlgorithm macAlgorithm}) → Chacha20
A factory used by Chacha20.
inherited
chacha20Poly1305Aead() → Chacha20
A factory used by Chacha20.poly1305Aead.
ecdhP256({required int length}) → Ecdh
A factory used by Ecdh.p256.
ecdhP384({required int length}) → Ecdh
A factory used by Ecdh.p384.
ecdhP521({required int length}) → Ecdh
A factory used by Ecdh.p521.
ecdsaP256(HashAlgorithm hashAlgorithm) → Ecdsa
A factory used by Ecdsa.p256.
ecdsaP384(HashAlgorithm hashAlgorithm) → Ecdsa
A factory used by Ecdsa.p384.
ecdsaP521(HashAlgorithm hashAlgorithm) → Ecdsa
A factory used by Ecdsa.p521.
ed25519() → Ed25519
A factory used by Ed25519.
hchacha20() → Hchacha20
A factory used by Hchacha20.
inherited
hkdf({required Hmac hmac, required int outputLength}) → Hkdf
A factory used by Hkdf.
inherited
hmac(HashAlgorithm hashAlgorithm) → Hmac
A factory used by Hmac.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pbkdf2({required MacAlgorithm macAlgorithm, required int iterations, required int bits}) → Pbkdf2
A factory used by Pbkdf2.
poly1305() → Poly1305
A factory used by Poly1305.
inherited
rsaPss(HashAlgorithm hashAlgorithm, {required int nonceLengthInBytes}) → RsaPss
A factory used by RsaPss.
inherited
rsaSsaPkcs1v15(HashAlgorithm hashAlgorithm) → RsaSsaPkcs1v15
A factory used by RsaSsaPkcs1v15.
inherited
sha1() → Sha1
A factory used by Sha1.
inherited
sha224() → Sha224
A factory used by Sha224.
inherited
sha256() → Sha256
A factory used by Sha256.
inherited
sha384() → Sha384
A factory used by Sha384.
inherited
sha512() → Sha512
A factory used by Sha512.
inherited
toString() String
A string representation of this object.
inherited
withRandom(Random? random) FlutterCryptography
x25519() → X25519
A factory used by X25519.
xchacha20({required MacAlgorithm macAlgorithm}) → Xchacha20
A factory used by Xchacha20.
inherited
xchacha20Poly1305Aead() → Xchacha20
A factory used by Xchacha20.poly1305Aead.
inherited

Operators

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

Static Properties

defaultInstance → Cryptography
Either FlutterCryptography or BrowserCryptography depending on FlutterCryptography.isPluginPresent.
final
isPluginPresent bool
Tells whether the current platform has a plugin.
no setter

Static Methods

enable() → void
registerWith() → void
Called by Flutter when the plugin is registered.