decryptAsymmetricBytes function

Uint8List decryptAsymmetricBytes(
  1. String encryptedBase64,
  2. String hexPrivateKey
)

Implementation

Uint8List decryptAsymmetricBytes(String encryptedBase64, String hexPrivateKey) {
  final encryptedBytes = base64.decode(encryptedBase64);

  final privKeyBytes = hex.decode(hexPrivateKey);
  final privKey = PrivateKey(privKeyBytes);

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