CryptEnvelope constructor

CryptEnvelope({
  1. int version = currentVersion,
  2. required CryptAlgorithm algorithm,
  3. required Uint8List ciphertext,
  4. required Uint8List nonce,
  5. Uint8List? tag,
  6. Uint8List? aad,
})

Cria um CryptEnvelope. Não aceita chave — por design, este tipo nunca carrega material de chave.

Implementation

CryptEnvelope({
  this.version = currentVersion,
  required this.algorithm,
  required this.ciphertext,
  required this.nonce,
  Uint8List? tag,
  Uint8List? aad,
})  : tag = tag ?? Uint8List(0),
      aad = aad ?? Uint8List(0) {
  if (version != currentVersion) {
    throw ArgumentError(
      'CryptEnvelope: unsupported envelope version $version; '
      'supported version: $currentVersion.',
    );
  }
}