sign method

Future<void> sign(
  1. WalletStore wallet,
  2. dynamic didToSignWith
)

Implementation

Future<void> sign(WalletStore wallet, didToSignWith) async {
  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');
  }
  jws = await signStringOrJson(
      wallet: wallet,
      didToSignWith: didToSignWith,
      toSign: payload,
      detached: true);
}