JOSE header

A JOSE (short for JSON object signing and encryption) header contains the algorithm that is used for signing, and the type of token (which is JWT).

A variety of encryption algorithms can be used with JWT. Here are some of the algorithms from JWT Specification at https://tools.ietf.org/html/rfc7518#section-3:

  • HS256: Uses HMAC with SHA-256
  • HS512: Uses HMAC with SHA-512
  • RS256: Uses RSASSA-PKCS1-v1_5 with SHA-256
  • RS512: Uses RSASSA-PKCS1-v1_5 with SHA-512

An example JOSE header using HS512 is shown here:

{
"alg": "HS512",
"typ": "JWT"
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset