toJson method

  1. @override
Map<String, dynamic> toJson()
override

Implementation

@override
Map<String, dynamic> toJson() {
  Map<String, dynamic> jsonObject = {};
  jsonObject['payload'] = removePaddingFromBase64(
      base64UrlEncode(utf8.encode(payload.toString())));

  if (signatures != null) {
    List sigs = [];
    for (var s in signatures!) {
      sigs.add(s.toJson());
    }
    jsonObject['signatures'] = sigs;
  }

  return jsonObject;
}