public byte[] EncodeAsUtf8Bytes <T>(T payload, DateTimeOffset?expire, Action <T, JwtWriter> payloadWriter) { var buffer = GetWriter(); try { var writer = new JwtWriter(buffer, signAlgorithm, expire); payloadWriter(payload, writer); return(buffer.ToUtf8Bytes()); } finally { buffer.Reset(); } }
public string Encode <T>(T payload, DateTimeOffset?expire, Action <T, JwtWriter> payloadWriter) { var buffer = GetWriter(); try { var writer = new JwtWriter(buffer, signAlgorithm, expire); payloadWriter(payload, writer); return(buffer.ToString()); } finally { buffer.Reset(); } }
public void Encode <T>(IBufferWriter <byte> bufferWriter, T payload, DateTimeOffset?expire, Action <T, JwtWriter> payloadWriter) { var writer = new JwtWriter(bufferWriter, signAlgorithm, expire); payloadWriter(payload, writer); }