The Payload class represents the 2nd part of the JWT, where the Payload value is held.
| 9 | * The Payload class represents the 2nd part of the JWT, where the Payload value is held. |
| 10 | */ |
| 11 | public interface Payload { |
| 12 | |
| 13 | /** |
| 14 | * Get the value of the "iss" claim, or null if it's not available. |
| 15 | * |
| 16 | * @return the Issuer value or null. |
| 17 | */ |
| 18 | String getIssuer(); |
| 19 | |
| 20 | /** |
| 21 | * Get the value of the "sub" claim, or null if it's not available. |
| 22 | * |
| 23 | * @return the Subject value or null. |
| 24 | */ |
| 25 | String getSubject(); |
| 26 | |
| 27 | /** |
| 28 | * Get the value of the "aud" claim, or null if it's not available. |
| 29 | * |
| 30 | * @return the Audience value or null. |
| 31 | */ |
| 32 | List<String> getAudience(); |
| 33 | |
| 34 | /** |
| 35 | * Get the value of the "exp" claim, or null if it's not available. |
| 36 | * |
| 37 | * @return the Expiration Time value or null. |
| 38 | */ |
| 39 | Date getExpiresAt(); |
| 40 | |
| 41 | /** |
| 42 | * Get the value of the "exp" claim as an {@linkplain Instant}, or null if it's not available. |
| 43 | * |
| 44 | * @return the Expiration Time value or null. |
| 45 | */ |
| 46 | default Instant getExpiresAtAsInstant() { |
| 47 | return getExpiresAt() != null ? getExpiresAt().toInstant() : null; |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * Get the value of the "nbf" claim, or null if it's not available. |
| 52 | * |
| 53 | * @return the Not Before value or null. |
| 54 | */ |
| 55 | Date getNotBefore(); |
| 56 | |
| 57 | /** |
| 58 | * Get the value of the "nbf" claim as an {@linkplain Instant}, or null if it's not available. |
| 59 | * |
| 60 | * @return the Not Before value or null. |
| 61 | */ |
| 62 | default Instant getNotBeforeAsInstant() { |
| 63 | return getNotBefore() != null ? getNotBefore().toInstant() : null; |
| 64 | } |
| 65 | |
| 66 | /** |
| 67 | * Get the value of the "iat" claim, or null if it's not available. |
| 68 | * |
no outgoing calls
no test coverage detected
searching dependent graphs…