decryptFolderEntry method

Uint8List decryptFolderEntry(
  1. Uint8List recipientSecretKey,
  2. PqEnvelope envelope, {
  3. Uint8List? aad,
  4. Uint8List? signerPublicKey,
})

Implementation

Uint8List decryptFolderEntry(
  Uint8List recipientSecretKey,
  PqEnvelope envelope, {
  Uint8List? aad,
  Uint8List? signerPublicKey,
}) {
  final relativePath = envelope.metadata['relativePath'];
  if (relativePath is! String || relativePath.isEmpty) {
    throw const PqForgeException(
      'folder envelope metadata must include relativePath',
    );
  }
  return decrypt(
    recipientSecretKey,
    envelope,
    aad: PqRecipeMessages.folderEntryAad(
      relativePath: relativePath,
      aad: aad,
    ),
    signerPublicKey: signerPublicKey,
  );
}