unmarshalEnvelopeFromProto function

Envelope unmarshalEnvelopeFromProto(
  1. Uint8List data
)

Unmarshals a serialized Envelope protobuf message, without validating its contents.

Implementation

Envelope unmarshalEnvelopeFromProto(Uint8List data) {
  final e = pb.Envelope.fromBuffer(data);
  final pubKey = publicKeyFromProto(e.publicKey);

  return Envelope(
    publicKey: pubKey,
    payloadType: Uint8List.fromList(e.payloadType),
    rawPayload: Uint8List.fromList(e.payload),
    signature: Uint8List.fromList(e.signature),
  );
}