decryptAsymmetricRaw function

Uint8List decryptAsymmetricRaw(
  1. Uint8List encryptedBytes,
  2. String hexPrivateKey
)

Implementation

Uint8List decryptAsymmetricRaw(Uint8List encryptedBytes, String hexPrivateKey) {
  final privKeyBytes = hex.decode(hexPrivateKey);
  final privKey = PrivateKey(privKeyBytes);

  final unsealedBox = SealedBox(privKey);
  return unsealedBox.decrypt(encryptedBytes);
}