validateDecoding function

CryptoEncodingValidation validateDecoding({
  1. required String encoded,
  2. CryptoDecodeOptions? opts,
})

Implementation

CryptoEncodingValidation validateDecoding({
  required String encoded,
  CryptoDecodeOptions? opts,
}) {
  final deserialized = deserialize(encoded);
  return validateEncoding(CryptoEncodeOptions(
    type: decodeTypeByte(deserialized.type),
    senderPublicKey: deserialized.senderPublicKey != null
        ? hex.encode(deserialized.senderPublicKey!)
        : null,
    receiverPublicKey: opts?.receiverPublicKey,
  ));
}