addRecipient method

void addRecipient(
  1. JsonWebKey? key, {
  2. String? algorithm,
})

Adds a key and algorithm to sign or encrypt this object

JsonWebSignature and JsonWebEncryption can have multiple recipients that use different keys. The compact serialization as a string can only have one recipient however.

Implementation

void addRecipient(JsonWebKey? key, {String? algorithm}) {
  recipients.add({'_jwk': key, 'alg': algorithm});
}