generate method

String generate(
  1. JwtPayload payload
)

Creates a new JWT token with a payload represented by payload.

Implementation

String generate(JwtPayload payload) {
  var headerBase64 = _serializeHeader();
  var payloadBase64 = _serializePayload(payload);

  var signature = _sign(headerBase64, payloadBase64);

  var ret = '$headerBase64.$payloadBase64.$signature';
  return ret;
}