sign method
Implementation
Future<void> sign(List<Map<String, dynamic>> jwkToSignWith) async {
signatures ??= [];
for (var jwk in jwkToSignWith) {
var signerImpl = _determineSignerForJwk(jwk, null);
Map<String, dynamic> protected = {
'typ': DidcommMessageTyp.signed.value,
'alg': signerImpl.algValue,
'crv': signerImpl.crvValue
};
var jws = await signStringOrJson(
jwk: jwk,
jwsHeader: protected,
signer: signerImpl,
toSign: _base64Payload != null
? utf8.decode(base64Decode(_base64Payload!))
: payload.toJson(),
detached: true);
signatures!.add(SignatureObject(
signature: jws.split('..').last, protected: protected));
}
return;
}