JwtData.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System.Collections.Generic;
  2. namespace Jwt
  3. {
  4. /// <summary>
  5. /// Represents a JSON Web Token.
  6. /// </summary>
  7. public class JwtData
  8. {
  9. /// <summary>
  10. /// Gets or sets the bytes representing the key of the JWT.
  11. /// </summary>
  12. public byte[] KeyBytes { get; set; }
  13. /// <summary>
  14. /// Gets or sets a string representing the key of the JWT.
  15. /// </summary>
  16. public string Key { get; set; }
  17. /// <summary>
  18. /// Gets or sets the payload of the JWT.
  19. /// </summary>
  20. public object Payload { get; set; }
  21. /// <summary>
  22. /// Gets or sets the hashing algorithm being used for the JWT.
  23. /// </summary>
  24. public JwtHashAlgorithm Algorithm { get; set; } = JwtHashAlgorithm.HS256;
  25. /// <summary>
  26. /// Gets or sets a value indicating whether the payload is already serialized to JSON.
  27. /// </summary>
  28. public bool Serialized { get; set; }
  29. /// <summary>
  30. /// Gets or sets a dictionary of extra heading to append to the JWT.
  31. /// </summary>
  32. public IDictionary<string, object> ExtraHeaders { get; set; }
  33. }
  34. }