serialize function
Implementation
String serialize({
required Uint8List type,
required Uint8List sealed,
required Uint8List iv,
Uint8List? senderPublicKey,
}) {
if (decodeTypeByte(type) == TYPE_1) {
if (senderPublicKey == null) {
throw WCException("Missing sender public key for type 1 envelope");
}
return base64Encode([...type, ...senderPublicKey, ...iv, ...sealed]);
}
// default to type 0 envelope
return base64Encode([...type, ...iv, ...sealed]);
}