wrap static method

Future<Uint8List> wrap(
  1. List<int> symmetricFileKey,
  2. SecretKey derivedKey
)

Implementation

static Future<Uint8List> wrap(
    List<int> symmetricFileKey, SecretKey derivedKey) async {
  final wrappingAlgorithm = Chacha20.poly1305Aead();
  final body = await wrappingAlgorithm.encrypt(symmetricFileKey,
      secretKey: derivedKey, nonce: List.generate(12, (index) => 0x00));
  return body.concatenation(nonce: false);
}