toJson method

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

Implementation

@override
Map<String, dynamic> toJson() {
  if (_originalDoc != null) return Map.from(_originalDoc!);

  Map<String, dynamic> jsonObject = {};
  jsonObject['type'] = type;
  jsonObject['proofPurpose'] = proofPurpose;
  jsonObject['verificationMethod'] = verificationMethod;
  jsonObject['created'] = created.toIso8601String();
  if (domain != null) jsonObject['domain'] = domain;
  if (challenge != null) jsonObject['challenge'] = challenge;
  if (proofValue != null) jsonObject['proofValue'] = proofValue;
  if (jws != null) jsonObject['jws'] = jws;
  return jsonObject;
}