View Javadoc

1   package com.atlassian.asap.api;
2   
3   /**
4    * The header of an ASAP JSON Web Token.
5    *
6    * @see <a href="https://tools.ietf.org/html/rfc7515">JSON Web Signature</a>
7    */
8   public interface JwsHeader {
9       /**
10       * @return the value of the 'kid' header. That is, the identifier of the key used to secure the JWT.
11       */
12      String getKeyId();
13  
14      /**
15       * @return the value of the 'alg' header. That is, the algorithm used to sign the JWT.
16       */
17      SigningAlgorithm getAlgorithm();
18  
19      /**
20       * The headers of a JWT message.
21       */
22      enum Header {
23          ALGORITHM("alg"),
24          KEY_ID("kid");
25  
26          private final String key;
27  
28          Header(String key) {
29              this.key = key;
30          }
31  
32          public String key() {
33              return key;
34          }
35      }
36  }