wrapAndSignAndJsonEncode method
FutureOr<String>
wrapAndSignAndJsonEncode(
- Object? payload, {
- Object? toEncodable(
- Object? nonEncodable
- EnvelopeType type = EnvelopeType.app,
inherited
Same as wrapAndSign but we also call jsonEncode for you :)
Implementation
FutureOr<String> wrapAndSignAndJsonEncode(
Object? payload, {
Object? Function(Object? nonEncodable)? toEncodable,
EnvelopeType type = EnvelopeType.app,
}) async {
final envelope =
await wrapAndSign(payload, toEncodable: toEncodable, type: type);
// NOTE: no toEncodable — the signing already encoded the payload to
// base64url, so what is left is strings.
return jsonEncode(envelope.toJson());
}