SignatureObject.fromJson constructor

SignatureObject.fromJson(
  1. dynamic jsonObject
)

Implementation

SignatureObject.fromJson(dynamic jsonObject) {
  var sig = credentialToMap(jsonObject);
  if (sig.containsKey('protected')) {
    protected = jsonDecode(
        utf8.decode(base64Decode(addPaddingToBase64(sig['protected']!))));
  }
  header = sig['header'];
  if (sig.containsKey('signature')) {
    signature = sig['signature'];
  } else {
    throw Exception('signature value is needed in SignatureObject');
  }
}