key static method

EncryptionKey key(
  1. Uint8List bytes
)

Creates an EncryptionKey from raw bytes.

If bytes is not exactly 32 bytes long, an ArgumentError is thrown.

It is important to use a cryptographically secure source of randomness to generate this key, for example Random.secure.

Implementation

static EncryptionKey key(Uint8List bytes) => EncryptionKeyImpl.key(bytes);