verifyJws method

Future<bool> verifyJws(
  1. String expectedDid
)

Implementation

Future<bool> verifyJws(String expectedDid) async {
  if (jws == null) throw Exception('no signature found');
  Map<String, dynamic> payload;
  if (json != null) {
    payload = json!;
  } else if (base64 != null) {
    payload =
        jsonDecode(utf8.decode(base64Decode(addPaddingToBase64(base64!))));
  } else {
    throw Exception('nothing to sign');
  }
  return verifyStringSignature(jws, expectedDid, toSign: payload);
}