encryptAsymmetricRaw function

Uint8List encryptAsymmetricRaw(
  1. Uint8List bytesPayload,
  2. String hexPublicKey
)

Implementation

Uint8List encryptAsymmetricRaw(Uint8List bytesPayload, String hexPublicKey) {
  final pubKey = PublicKey(hex.decode(hexPublicKey));
  final sealedBox = SealedBox(pubKey);

  return sealedBox.encrypt(bytesPayload);
}