mirror of https://github.com/jwtk/jjwt.git
0.12.0 staging complete (#847)
* replaced JJWT_RELEASE_VERSION placeholders with 0.12.0 * [maven-release-plugin] prepare release 0.12.0 * [maven-release-plugin] prepare for next development iteration
This commit is contained in:
parent
b411b19b92
commit
0c3040922a
|
@ -1,6 +1,6 @@
|
||||||
## Release Notes
|
## Release Notes
|
||||||
|
|
||||||
### JJWT_RELEASE_VERSION
|
### 0.12.0
|
||||||
|
|
||||||
This is a big release! JJWT now fully supports Encrypted JSON Web Tokens (JWE), JSON Web Keys (JWK) and more! See the
|
This is a big release! JJWT now fully supports Encrypted JSON Web Tokens (JWE), JSON Web Keys (JWK) and more! See the
|
||||||
sections below enumerating all new features as well as important notes on breaking changes or backwards-incompatible
|
sections below enumerating all new features as well as important notes on breaking changes or backwards-incompatible
|
||||||
|
|
26
README.md
26
README.md
|
@ -540,18 +540,18 @@ If you're building a (non-Android) JDK project, you will want to define the foll
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.jsonwebtoken</groupId>
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
<artifactId>jjwt-api</artifactId>
|
<artifactId>jjwt-api</artifactId>
|
||||||
<version>JJWT_RELEASE_VERSION</version>
|
<version>0.12.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.jsonwebtoken</groupId>
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
<artifactId>jjwt-impl</artifactId>
|
<artifactId>jjwt-impl</artifactId>
|
||||||
<version>JJWT_RELEASE_VERSION</version>
|
<version>0.12.0</version>
|
||||||
<scope>runtime</scope>
|
<scope>runtime</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.jsonwebtoken</groupId>
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
<artifactId>jjwt-jackson</artifactId> <!-- or jjwt-gson if Gson is preferred -->
|
<artifactId>jjwt-jackson</artifactId> <!-- or jjwt-gson if Gson is preferred -->
|
||||||
<version>JJWT_RELEASE_VERSION</version>
|
<version>0.12.0</version>
|
||||||
<scope>runtime</scope>
|
<scope>runtime</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- Uncomment this next dependency if you are using:
|
<!-- Uncomment this next dependency if you are using:
|
||||||
|
@ -574,9 +574,9 @@ If you're building a (non-Android) JDK project, you will want to define the foll
|
||||||
|
|
||||||
```groovy
|
```groovy
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'io.jsonwebtoken:jjwt-api:JJWT_RELEASE_VERSION'
|
implementation 'io.jsonwebtoken:jjwt-api:0.12.0'
|
||||||
runtimeOnly 'io.jsonwebtoken:jjwt-impl:JJWT_RELEASE_VERSION'
|
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.12.0'
|
||||||
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:JJWT_RELEASE_VERSION' // or 'io.jsonwebtoken:jjwt-gson:JJWT_RELEASE_VERSION' for gson
|
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.12.0' // or 'io.jsonwebtoken:jjwt-gson:0.12.0' for gson
|
||||||
/*
|
/*
|
||||||
Uncomment this next dependency if you are using:
|
Uncomment this next dependency if you are using:
|
||||||
- JDK 10 or earlier, and you want to use RSASSA-PSS (PS256, PS384, PS512) signature algorithms.
|
- JDK 10 or earlier, and you want to use RSASSA-PSS (PS256, PS384, PS512) signature algorithms.
|
||||||
|
@ -601,9 +601,9 @@ Add the dependencies to your project:
|
||||||
|
|
||||||
```groovy
|
```groovy
|
||||||
dependencies {
|
dependencies {
|
||||||
api('io.jsonwebtoken:jjwt-api:JJWT_RELEASE_VERSION')
|
api('io.jsonwebtoken:jjwt-api:0.12.0')
|
||||||
runtimeOnly('io.jsonwebtoken:jjwt-impl:JJWT_RELEASE_VERSION')
|
runtimeOnly('io.jsonwebtoken:jjwt-impl:0.12.0')
|
||||||
runtimeOnly('io.jsonwebtoken:jjwt-orgjson:JJWT_RELEASE_VERSION') {
|
runtimeOnly('io.jsonwebtoken:jjwt-orgjson:0.12.0') {
|
||||||
exclude(group: 'org.json', module: 'json') //provided by Android natively
|
exclude(group: 'org.json', module: 'json') //provided by Android natively
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
@ -2952,7 +2952,7 @@ scope which is the typical JJWT default). That is:
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.jsonwebtoken</groupId>
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
<artifactId>jjwt-jackson</artifactId>
|
<artifactId>jjwt-jackson</artifactId>
|
||||||
<version>JJWT_RELEASE_VERSION</version>
|
<version>0.12.0</version>
|
||||||
<scope>compile</scope> <!-- Not runtime -->
|
<scope>compile</scope> <!-- Not runtime -->
|
||||||
</dependency>
|
</dependency>
|
||||||
```
|
```
|
||||||
|
@ -2961,7 +2961,7 @@ scope which is the typical JJWT default). That is:
|
||||||
|
|
||||||
```groovy
|
```groovy
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'io.jsonwebtoken:jjwt-jackson:JJWT_RELEASE_VERSION'
|
implementation 'io.jsonwebtoken:jjwt-jackson:0.12.0'
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -3069,7 +3069,7 @@ scope which is the typical JJWT default). That is:
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.jsonwebtoken</groupId>
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
<artifactId>jjwt-gson</artifactId>
|
<artifactId>jjwt-gson</artifactId>
|
||||||
<version>JJWT_RELEASE_VERSION</version>
|
<version>0.12.0</version>
|
||||||
<scope>compile</scope> <!-- Not runtime -->
|
<scope>compile</scope> <!-- Not runtime -->
|
||||||
</dependency>
|
</dependency>
|
||||||
```
|
```
|
||||||
|
@ -3078,7 +3078,7 @@ scope which is the typical JJWT default). That is:
|
||||||
|
|
||||||
```groovy
|
```groovy
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'io.jsonwebtoken:jjwt-gson:JJWT_RELEASE_VERSION'
|
implementation 'io.jsonwebtoken:jjwt-gson:0.12.0'
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>io.jsonwebtoken</groupId>
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
<artifactId>jjwt-root</artifactId>
|
<artifactId>jjwt-root</artifactId>
|
||||||
<version>0.11.6-SNAPSHOT</version>
|
<version>0.13.0-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ import io.jsonwebtoken.lang.MapMutator;
|
||||||
*
|
*
|
||||||
* @see JwtBuilder
|
* @see JwtBuilder
|
||||||
* @see Claims
|
* @see Claims
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface ClaimsBuilder extends MapMutator<String, Object, ClaimsBuilder>, ClaimsMutator<ClaimsBuilder>, Builder<Claims> {
|
public interface ClaimsBuilder extends MapMutator<String, Object, ClaimsBuilder>, ClaimsMutator<ClaimsBuilder>, Builder<Claims> {
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ public interface ClaimsMutator<T extends ClaimsMutator<T>> {
|
||||||
*
|
*
|
||||||
* @param iss the JWT {@code iss} value or {@code null} to remove the property from the JSON map.
|
* @param iss the JWT {@code iss} value or {@code null} to remove the property from the JSON map.
|
||||||
* @return the {@code Claims} instance for method chaining.
|
* @return the {@code Claims} instance for method chaining.
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of the shorter and more modern builder-style named
|
* @deprecated since 0.12.0 in favor of the shorter and more modern builder-style named
|
||||||
* {@link #issuer(String)}. This method will be removed before the JJWT 1.0 release.
|
* {@link #issuer(String)}. This method will be removed before the JJWT 1.0 release.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -48,7 +48,7 @@ public interface ClaimsMutator<T extends ClaimsMutator<T>> {
|
||||||
*
|
*
|
||||||
* @param iss the JWT {@code iss} value or {@code null} to remove the property from the JSON map.
|
* @param iss the JWT {@code iss} value or {@code null} to remove the property from the JSON map.
|
||||||
* @return the {@code Claims} instance for method chaining.
|
* @return the {@code Claims} instance for method chaining.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
T issuer(String iss);
|
T issuer(String iss);
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ public interface ClaimsMutator<T extends ClaimsMutator<T>> {
|
||||||
*
|
*
|
||||||
* @param sub the JWT {@code sub} value or {@code null} to remove the property from the JSON map.
|
* @param sub the JWT {@code sub} value or {@code null} to remove the property from the JSON map.
|
||||||
* @return the {@code Claims} instance for method chaining.
|
* @return the {@code Claims} instance for method chaining.
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of the shorter and more modern builder-style named
|
* @deprecated since 0.12.0 in favor of the shorter and more modern builder-style named
|
||||||
* {@link #subject(String)}. This method will be removed before the JJWT 1.0 release.
|
* {@link #subject(String)}. This method will be removed before the JJWT 1.0 release.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -70,7 +70,7 @@ public interface ClaimsMutator<T extends ClaimsMutator<T>> {
|
||||||
*
|
*
|
||||||
* @param sub the JWT {@code sub} value or {@code null} to remove the property from the JSON map.
|
* @param sub the JWT {@code sub} value or {@code null} to remove the property from the JSON map.
|
||||||
* @return the {@code Claims} instance for method chaining.
|
* @return the {@code Claims} instance for method chaining.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
T subject(String sub);
|
T subject(String sub);
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ public interface ClaimsMutator<T extends ClaimsMutator<T>> {
|
||||||
*
|
*
|
||||||
* @param aud the JWT {@code aud} value or {@code null} to remove the property from the JSON map.
|
* @param aud the JWT {@code aud} value or {@code null} to remove the property from the JSON map.
|
||||||
* @return the {@code Claims} instance for method chaining.
|
* @return the {@code Claims} instance for method chaining.
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #audience()}. This method will be removed before
|
* @deprecated since 0.12.0 in favor of {@link #audience()}. This method will be removed before
|
||||||
* the JJWT 1.0 release.
|
* the JJWT 1.0 release.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -99,7 +99,7 @@ public interface ClaimsMutator<T extends ClaimsMutator<T>> {
|
||||||
* @return the {@link AudienceCollection AudienceCollection} to use for {@code aud} configuration.
|
* @return the {@link AudienceCollection AudienceCollection} to use for {@code aud} configuration.
|
||||||
* @see AudienceCollection AudienceCollection
|
* @see AudienceCollection AudienceCollection
|
||||||
* @see AudienceCollection#single(String) AudienceCollection.single(String)
|
* @see AudienceCollection#single(String) AudienceCollection.single(String)
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
AudienceCollection<T> audience();
|
AudienceCollection<T> audience();
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ public interface ClaimsMutator<T extends ClaimsMutator<T>> {
|
||||||
*
|
*
|
||||||
* @param exp the JWT {@code exp} value or {@code null} to remove the property from the JSON map.
|
* @param exp the JWT {@code exp} value or {@code null} to remove the property from the JSON map.
|
||||||
* @return the {@code Claims} instance for method chaining.
|
* @return the {@code Claims} instance for method chaining.
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of the shorter and more modern builder-style named
|
* @deprecated since 0.12.0 in favor of the shorter and more modern builder-style named
|
||||||
* {@link #expiration(Date)}. This method will be removed before the JJWT 1.0 release.
|
* {@link #expiration(Date)}. This method will be removed before the JJWT 1.0 release.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -127,7 +127,7 @@ public interface ClaimsMutator<T extends ClaimsMutator<T>> {
|
||||||
*
|
*
|
||||||
* @param exp the JWT {@code exp} value or {@code null} to remove the property from the JSON map.
|
* @param exp the JWT {@code exp} value or {@code null} to remove the property from the JSON map.
|
||||||
* @return the {@code Claims} instance for method chaining.
|
* @return the {@code Claims} instance for method chaining.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
T expiration(Date exp);
|
T expiration(Date exp);
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ public interface ClaimsMutator<T extends ClaimsMutator<T>> {
|
||||||
*
|
*
|
||||||
* @param nbf the JWT {@code nbf} value or {@code null} to remove the property from the JSON map.
|
* @param nbf the JWT {@code nbf} value or {@code null} to remove the property from the JSON map.
|
||||||
* @return the {@code Claims} instance for method chaining.
|
* @return the {@code Claims} instance for method chaining.
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of the shorter and more modern builder-style named
|
* @deprecated since 0.12.0 in favor of the shorter and more modern builder-style named
|
||||||
* {@link #notBefore(Date)}. This method will be removed before the JJWT 1.0 release.
|
* {@link #notBefore(Date)}. This method will be removed before the JJWT 1.0 release.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -155,7 +155,7 @@ public interface ClaimsMutator<T extends ClaimsMutator<T>> {
|
||||||
*
|
*
|
||||||
* @param nbf the JWT {@code nbf} value or {@code null} to remove the property from the JSON map.
|
* @param nbf the JWT {@code nbf} value or {@code null} to remove the property from the JSON map.
|
||||||
* @return the {@code Claims} instance for method chaining.
|
* @return the {@code Claims} instance for method chaining.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
T notBefore(Date nbf);
|
T notBefore(Date nbf);
|
||||||
|
|
||||||
|
@ -168,7 +168,7 @@ public interface ClaimsMutator<T extends ClaimsMutator<T>> {
|
||||||
*
|
*
|
||||||
* @param iat the JWT {@code iat} value or {@code null} to remove the property from the JSON map.
|
* @param iat the JWT {@code iat} value or {@code null} to remove the property from the JSON map.
|
||||||
* @return the {@code Claims} instance for method chaining.
|
* @return the {@code Claims} instance for method chaining.
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of the shorter and more modern builder-style named
|
* @deprecated since 0.12.0 in favor of the shorter and more modern builder-style named
|
||||||
* {@link #issuedAt(Date)}. This method will be removed before the JJWT 1.0 release.
|
* {@link #issuedAt(Date)}. This method will be removed before the JJWT 1.0 release.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -183,7 +183,7 @@ public interface ClaimsMutator<T extends ClaimsMutator<T>> {
|
||||||
*
|
*
|
||||||
* @param iat the JWT {@code iat} value or {@code null} to remove the property from the JSON map.
|
* @param iat the JWT {@code iat} value or {@code null} to remove the property from the JSON map.
|
||||||
* @return the {@code Claims} instance for method chaining.
|
* @return the {@code Claims} instance for method chaining.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
T issuedAt(Date iat);
|
T issuedAt(Date iat);
|
||||||
|
|
||||||
|
@ -197,7 +197,7 @@ public interface ClaimsMutator<T extends ClaimsMutator<T>> {
|
||||||
*
|
*
|
||||||
* @param jti the JWT {@code jti} value or {@code null} to remove the property from the JSON map.
|
* @param jti the JWT {@code jti} value or {@code null} to remove the property from the JSON map.
|
||||||
* @return the {@code Claims} instance for method chaining.
|
* @return the {@code Claims} instance for method chaining.
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of the shorter and more modern builder-style named
|
* @deprecated since 0.12.0 in favor of the shorter and more modern builder-style named
|
||||||
* {@link #id(String)}. This method will be removed before the JJWT 1.0 release.
|
* {@link #id(String)}. This method will be removed before the JJWT 1.0 release.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -213,7 +213,7 @@ public interface ClaimsMutator<T extends ClaimsMutator<T>> {
|
||||||
*
|
*
|
||||||
* @param jti the JWT {@code jti} value or {@code null} to remove the property from the JSON map.
|
* @param jti the JWT {@code jti} value or {@code null} to remove the property from the JSON map.
|
||||||
* @return the {@code Claims} instance for method chaining.
|
* @return the {@code Claims} instance for method chaining.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
T id(String jti);
|
T id(String jti);
|
||||||
|
|
||||||
|
@ -223,7 +223,7 @@ public interface ClaimsMutator<T extends ClaimsMutator<T>> {
|
||||||
*
|
*
|
||||||
* @param <P> the type of ClaimsMutator to return for method chaining.
|
* @param <P> the type of ClaimsMutator to return for method chaining.
|
||||||
* @see #single(String)
|
* @see #single(String)
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
interface AudienceCollection<P> extends NestedCollection<String, P> {
|
interface AudienceCollection<P> extends NestedCollection<String, P> {
|
||||||
|
|
||||||
|
@ -238,7 +238,7 @@ public interface ClaimsMutator<T extends ClaimsMutator<T>> {
|
||||||
* @param aud the value to use as the {@code aud} Claim single-String value (and not an array of Strings), or
|
* @param aud the value to use as the {@code aud} Claim single-String value (and not an array of Strings), or
|
||||||
* {@code null}, empty or whitespace to remove the property from the JSON map.
|
* {@code null}, empty or whitespace to remove the property from the JSON map.
|
||||||
* @return the instance for method chaining
|
* @return the instance for method chaining
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
* @deprecated This is technically not deprecated because the JWT RFC mandates support for single string values,
|
* @deprecated This is technically not deprecated because the JWT RFC mandates support for single string values,
|
||||||
* but it is marked as deprecated to discourage its use when possible.
|
* but it is marked as deprecated to discourage its use when possible.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -29,7 +29,7 @@ import io.jsonwebtoken.io.CompressionAlgorithm;
|
||||||
* @see Jwts.ZIP#DEF
|
* @see Jwts.ZIP#DEF
|
||||||
* @see Jwts.ZIP#GZIP
|
* @see Jwts.ZIP#GZIP
|
||||||
* @since 0.6.0
|
* @since 0.6.0
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link io.jsonwebtoken.io.CompressionAlgorithm} to equal the RFC name for this concept.
|
* @deprecated since 0.12.0 in favor of {@link io.jsonwebtoken.io.CompressionAlgorithm} to equal the RFC name for this concept.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public interface CompressionCodec extends CompressionAlgorithm {
|
public interface CompressionCodec extends CompressionAlgorithm {
|
||||||
|
@ -40,7 +40,7 @@ public interface CompressionCodec extends CompressionAlgorithm {
|
||||||
*
|
*
|
||||||
* @return the algorithm name to use as the JWT
|
* @return the algorithm name to use as the JWT
|
||||||
* <a href="https://tools.ietf.org/html/rfc7516#section-4.1.3"><code>zip</code></a> header value.
|
* <a href="https://tools.ietf.org/html/rfc7516#section-4.1.3"><code>zip</code></a> header value.
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #getId()} to ensure congruence with
|
* @deprecated since 0.12.0 in favor of {@link #getId()} to ensure congruence with
|
||||||
* all other identifiable algorithms.
|
* all other identifiable algorithms.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("DeprecatedIsStillUsed")
|
@SuppressWarnings("DeprecatedIsStillUsed")
|
||||||
|
|
|
@ -47,21 +47,21 @@ public interface Header extends Map<String, Object> {
|
||||||
/**
|
/**
|
||||||
* JWT {@code Type} (typ) value: <code>"JWT"</code>
|
* JWT {@code Type} (typ) value: <code>"JWT"</code>
|
||||||
*
|
*
|
||||||
* @deprecated since JJWT_RELEASE_VERSION - this constant is never used within the JJWT codebase.
|
* @deprecated since 0.12.0 - this constant is never used within the JJWT codebase.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
String JWT_TYPE = "JWT";
|
String JWT_TYPE = "JWT";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* JWT {@code Type} header parameter name: <code>"typ"</code>
|
* JWT {@code Type} header parameter name: <code>"typ"</code>
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #getType()}.
|
* @deprecated since 0.12.0 in favor of {@link #getType()}.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
String TYPE = "typ";
|
String TYPE = "typ";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* JWT {@code Content Type} header parameter name: <code>"cty"</code>
|
* JWT {@code Content Type} header parameter name: <code>"cty"</code>
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #getContentType()}.
|
* @deprecated since 0.12.0 in favor of {@link #getContentType()}.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
String CONTENT_TYPE = "cty";
|
String CONTENT_TYPE = "cty";
|
||||||
|
@ -71,14 +71,14 @@ public interface Header extends Map<String, Object> {
|
||||||
*
|
*
|
||||||
* @see <a href="https://tools.ietf.org/html/rfc7515#section-4.1.1">JWS Algorithm Header</a>
|
* @see <a href="https://tools.ietf.org/html/rfc7515#section-4.1.1">JWS Algorithm Header</a>
|
||||||
* @see <a href="https://tools.ietf.org/html/rfc7516#section-4.1.1">JWE Algorithm Header</a>
|
* @see <a href="https://tools.ietf.org/html/rfc7516#section-4.1.1">JWE Algorithm Header</a>
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #getAlgorithm()}.
|
* @deprecated since 0.12.0 in favor of {@link #getAlgorithm()}.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
String ALGORITHM = "alg";
|
String ALGORITHM = "alg";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* JWT {@code Compression Algorithm} header parameter name: <code>"zip"</code>
|
* JWT {@code Compression Algorithm} header parameter name: <code>"zip"</code>
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #getCompressionAlgorithm()}
|
* @deprecated since 0.12.0 in favor of {@link #getCompressionAlgorithm()}
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
String COMPRESSION_ALGORITHM = "zip";
|
String COMPRESSION_ALGORITHM = "zip";
|
||||||
|
@ -143,7 +143,7 @@ public interface Header extends Map<String, Object> {
|
||||||
*
|
*
|
||||||
* @return the {@code alg} header value or {@code null} if not present. This will always be
|
* @return the {@code alg} header value or {@code null} if not present. This will always be
|
||||||
* {@code non-null} on validly constructed JWT instances, but could be {@code null} during construction.
|
* {@code non-null} on validly constructed JWT instances, but could be {@code null} during construction.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
String getAlgorithm();
|
String getAlgorithm();
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ import io.jsonwebtoken.lang.MapMutator;
|
||||||
* Mutation (modifications) to a {@link Header Header} instance.
|
* Mutation (modifications) to a {@link Header Header} instance.
|
||||||
*
|
*
|
||||||
* @param <T> the mutator subtype, for method chaining
|
* @param <T> the mutator subtype, for method chaining
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface HeaderMutator<T extends HeaderMutator<T>> extends MapMutator<String, Object, T> {
|
public interface HeaderMutator<T extends HeaderMutator<T>> extends MapMutator<String, Object, T> {
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ public interface HeaderMutator<T extends HeaderMutator<T>> extends MapMutator<St
|
||||||
*
|
*
|
||||||
* @param alg the {@code alg} header value
|
* @param alg the {@code alg} header value
|
||||||
* @return this header for method chaining
|
* @return this header for method chaining
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*
|
*
|
||||||
T algorithm(String alg);
|
T algorithm(String alg);
|
||||||
*/
|
*/
|
||||||
|
@ -95,36 +95,36 @@ public interface HeaderMutator<T extends HeaderMutator<T>> extends MapMutator<St
|
||||||
T contentType(String cty);
|
T contentType(String cty);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deprecated since of JJWT_RELEASE_VERSION, delegates to {@link #type(String)}.
|
* Deprecated since of 0.12.0, delegates to {@link #type(String)}.
|
||||||
*
|
*
|
||||||
* @param typ the JWT JOSE {@code typ} header value or {@code null} to remove the property from the JSON map.
|
* @param typ the JWT JOSE {@code typ} header value or {@code null} to remove the property from the JSON map.
|
||||||
* @return the instance for method chaining.
|
* @return the instance for method chaining.
|
||||||
* @see #type(String)
|
* @see #type(String)
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of the more modern builder-style {@link #type(String)} method.
|
* @deprecated since 0.12.0 in favor of the more modern builder-style {@link #type(String)} method.
|
||||||
* This method will be removed before the 1.0 release.
|
* This method will be removed before the 1.0 release.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
T setType(String typ);
|
T setType(String typ);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deprecated as of JJWT_RELEASE_VERSION, delegates to {@link #contentType(String)}.
|
* Deprecated as of 0.12.0, delegates to {@link #contentType(String)}.
|
||||||
*
|
*
|
||||||
* @param cty the JWT JOSE {@code cty} header value or {@code null} to remove the property from the JSON map.
|
* @param cty the JWT JOSE {@code cty} header value or {@code null} to remove the property from the JSON map.
|
||||||
* @return the instance for method chaining.
|
* @return the instance for method chaining.
|
||||||
* @see #contentType(String)
|
* @see #contentType(String)
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of the more modern builder-style {@link #contentType(String)}.
|
* @deprecated since 0.12.0 in favor of the more modern builder-style {@link #contentType(String)}.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
T setContentType(String cty);
|
T setContentType(String cty);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deprecated as of JJWT_RELEASE_VERSION, there is no need to set this any longer as the {@code JwtBuilder} will
|
* Deprecated as of 0.12.0, there is no need to set this any longer as the {@code JwtBuilder} will
|
||||||
* always set the {@code zip} header as necessary.
|
* always set the {@code zip} header as necessary.
|
||||||
*
|
*
|
||||||
* @param zip the JWT compression algorithm {@code zip} value or {@code null} to remove the property from the JSON map.
|
* @param zip the JWT compression algorithm {@code zip} value or {@code null} to remove the property from the JSON map.
|
||||||
* @return the instance for method chaining.
|
* @return the instance for method chaining.
|
||||||
* @since 0.6.0
|
* @since 0.6.0
|
||||||
* @deprecated since JJWT_RELEASE_VERSION and will be removed before the 1.0 release.
|
* @deprecated since 0.12.0 and will be removed before the 1.0 release.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
T setCompressionAlgorithm(String zip);
|
T setCompressionAlgorithm(String zip);
|
||||||
|
|
|
@ -79,7 +79,7 @@ package io.jsonwebtoken;
|
||||||
* </tbody>
|
* </tbody>
|
||||||
* </table>
|
* </table>
|
||||||
*
|
*
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface Identifiable {
|
public interface Identifiable {
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ package io.jsonwebtoken;
|
||||||
* <a href="https://www.rfc-editor.org/rfc/rfc7516.html">JWE (RFC 7516) Specification</a>.
|
* <a href="https://www.rfc-editor.org/rfc/rfc7516.html">JWE (RFC 7516) Specification</a>.
|
||||||
*
|
*
|
||||||
* @param <B> payload type, either {@link Claims} or {@code byte[]} content.
|
* @param <B> payload type, either {@link Claims} or {@code byte[]} content.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface Jwe<B> extends ProtectedJwt<JweHeader, B> {
|
public interface Jwe<B> extends ProtectedJwt<JweHeader, B> {
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ public interface Jwe<B> extends ProtectedJwt<JweHeader, B> {
|
||||||
* {@link UnsupportedJwtException}.
|
* {@link UnsupportedJwtException}.
|
||||||
*
|
*
|
||||||
* @see SupportedJwtVisitor#onDecryptedContent(Jwe)
|
* @see SupportedJwtVisitor#onDecryptedContent(Jwe)
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("UnnecessaryModifier")
|
@SuppressWarnings("UnnecessaryModifier")
|
||||||
public static final JwtVisitor<Jwe<byte[]>> CONTENT = new SupportedJwtVisitor<Jwe<byte[]>>() {
|
public static final JwtVisitor<Jwe<byte[]>> CONTENT = new SupportedJwtVisitor<Jwe<byte[]>>() {
|
||||||
|
@ -46,7 +46,7 @@ public interface Jwe<B> extends ProtectedJwt<JweHeader, B> {
|
||||||
* {@link UnsupportedJwtException}.
|
* {@link UnsupportedJwtException}.
|
||||||
*
|
*
|
||||||
* @see SupportedJwtVisitor#onDecryptedClaims(Jwe)
|
* @see SupportedJwtVisitor#onDecryptedClaims(Jwe)
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("UnnecessaryModifier")
|
@SuppressWarnings("UnnecessaryModifier")
|
||||||
public static final JwtVisitor<Jwe<Claims>> CLAIMS = new SupportedJwtVisitor<Jwe<Claims>>() {
|
public static final JwtVisitor<Jwe<Claims>> CLAIMS = new SupportedJwtVisitor<Jwe<Claims>>() {
|
||||||
|
|
|
@ -25,7 +25,7 @@ import java.security.Key;
|
||||||
/**
|
/**
|
||||||
* A <a href="https://www.rfc-editor.org/rfc/rfc7516.html">JWE</a> header.
|
* A <a href="https://www.rfc-editor.org/rfc/rfc7516.html">JWE</a> header.
|
||||||
*
|
*
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface JweHeader extends ProtectedHeader {
|
public interface JweHeader extends ProtectedHeader {
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ import io.jsonwebtoken.security.KeyAlgorithm;
|
||||||
* Mutation (modifications) to a {@link JweHeader} instance.
|
* Mutation (modifications) to a {@link JweHeader} instance.
|
||||||
*
|
*
|
||||||
* @param <T> the mutator subtype, for method chaining
|
* @param <T> the mutator subtype, for method chaining
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface JweHeaderMutator<T extends JweHeaderMutator<T>> extends ProtectedHeaderMutator<T> {
|
public interface JweHeaderMutator<T extends JweHeaderMutator<T>> extends ProtectedHeaderMutator<T> {
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ public interface Jws<P> extends ProtectedJwt<JwsHeader, P> {
|
||||||
* {@link UnsupportedJwtException}.
|
* {@link UnsupportedJwtException}.
|
||||||
*
|
*
|
||||||
* @see SupportedJwtVisitor#onVerifiedContent(Jws)
|
* @see SupportedJwtVisitor#onVerifiedContent(Jws)
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("UnnecessaryModifier")
|
@SuppressWarnings("UnnecessaryModifier")
|
||||||
public static final JwtVisitor<Jws<byte[]>> CONTENT = new SupportedJwtVisitor<Jws<byte[]>>() {
|
public static final JwtVisitor<Jws<byte[]>> CONTENT = new SupportedJwtVisitor<Jws<byte[]>>() {
|
||||||
|
@ -45,7 +45,7 @@ public interface Jws<P> extends ProtectedJwt<JwsHeader, P> {
|
||||||
* {@link UnsupportedJwtException}.
|
* {@link UnsupportedJwtException}.
|
||||||
*
|
*
|
||||||
* @see SupportedJwtVisitor#onVerifiedClaims(Jws)
|
* @see SupportedJwtVisitor#onVerifiedClaims(Jws)
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("UnnecessaryModifier")
|
@SuppressWarnings("UnnecessaryModifier")
|
||||||
public static final JwtVisitor<Jws<Claims>> CLAIMS = new SupportedJwtVisitor<Jws<Claims>>() {
|
public static final JwtVisitor<Jws<Claims>> CLAIMS = new SupportedJwtVisitor<Jws<Claims>>() {
|
||||||
|
@ -59,7 +59,7 @@ public interface Jws<P> extends ProtectedJwt<JwsHeader, P> {
|
||||||
* Returns the verified JWS signature as a Base64Url string.
|
* Returns the verified JWS signature as a Base64Url string.
|
||||||
*
|
*
|
||||||
* @return the verified JWS signature as a Base64Url string.
|
* @return the verified JWS signature as a Base64Url string.
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #getDigest() getDigest()}.
|
* @deprecated since 0.12.0 in favor of {@link #getDigest() getDigest()}.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
String getSignature(); //TODO for 1.0: return a byte[]
|
String getSignature(); //TODO for 1.0: return a byte[]
|
||||||
|
|
|
@ -25,7 +25,7 @@ public interface JwsHeader extends ProtectedHeader {
|
||||||
/**
|
/**
|
||||||
* JWS <a href="https://tools.ietf.org/html/rfc7515#section-4.1.1">Algorithm Header</a> name: the string literal <b><code>alg</code></b>
|
* JWS <a href="https://tools.ietf.org/html/rfc7515#section-4.1.1">Algorithm Header</a> name: the string literal <b><code>alg</code></b>
|
||||||
*
|
*
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #getAlgorithm()}
|
* @deprecated since 0.12.0 in favor of {@link #getAlgorithm()}
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
String ALGORITHM = "alg";
|
String ALGORITHM = "alg";
|
||||||
|
@ -33,7 +33,7 @@ public interface JwsHeader extends ProtectedHeader {
|
||||||
/**
|
/**
|
||||||
* JWS <a href="https://tools.ietf.org/html/rfc7515#section-4.1.2">JWK Set URL Header</a> name: the string literal <b><code>jku</code></b>
|
* JWS <a href="https://tools.ietf.org/html/rfc7515#section-4.1.2">JWK Set URL Header</a> name: the string literal <b><code>jku</code></b>
|
||||||
*
|
*
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #getJwkSetUrl()}
|
* @deprecated since 0.12.0 in favor of {@link #getJwkSetUrl()}
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
String JWK_SET_URL = "jku";
|
String JWK_SET_URL = "jku";
|
||||||
|
@ -41,7 +41,7 @@ public interface JwsHeader extends ProtectedHeader {
|
||||||
/**
|
/**
|
||||||
* JWS <a href="https://tools.ietf.org/html/rfc7515#section-4.1.3">JSON Web Key Header</a> name: the string literal <b><code>jwk</code></b>
|
* JWS <a href="https://tools.ietf.org/html/rfc7515#section-4.1.3">JSON Web Key Header</a> name: the string literal <b><code>jwk</code></b>
|
||||||
*
|
*
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #getJwk()}
|
* @deprecated since 0.12.0 in favor of {@link #getJwk()}
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
String JSON_WEB_KEY = "jwk";
|
String JSON_WEB_KEY = "jwk";
|
||||||
|
@ -49,7 +49,7 @@ public interface JwsHeader extends ProtectedHeader {
|
||||||
/**
|
/**
|
||||||
* JWS <a href="https://tools.ietf.org/html/rfc7516#section-4.1.4">Key ID Header</a> name: the string literal <b><code>kid</code></b>
|
* JWS <a href="https://tools.ietf.org/html/rfc7516#section-4.1.4">Key ID Header</a> name: the string literal <b><code>kid</code></b>
|
||||||
*
|
*
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #getKeyId()}
|
* @deprecated since 0.12.0 in favor of {@link #getKeyId()}
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
String KEY_ID = "kid";
|
String KEY_ID = "kid";
|
||||||
|
@ -57,7 +57,7 @@ public interface JwsHeader extends ProtectedHeader {
|
||||||
/**
|
/**
|
||||||
* JWS <a href="https://tools.ietf.org/html/rfc7516#section-4.1.5">X.509 URL Header</a> name: the string literal <b><code>x5u</code></b>
|
* JWS <a href="https://tools.ietf.org/html/rfc7516#section-4.1.5">X.509 URL Header</a> name: the string literal <b><code>x5u</code></b>
|
||||||
*
|
*
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #getX509Url()}
|
* @deprecated since 0.12.0 in favor of {@link #getX509Url()}
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
String X509_URL = "x5u";
|
String X509_URL = "x5u";
|
||||||
|
@ -65,7 +65,7 @@ public interface JwsHeader extends ProtectedHeader {
|
||||||
/**
|
/**
|
||||||
* JWS <a href="https://tools.ietf.org/html/rfc7516#section-4.1.6">X.509 Certificate Chain Header</a> name: the string literal <b><code>x5c</code></b>
|
* JWS <a href="https://tools.ietf.org/html/rfc7516#section-4.1.6">X.509 Certificate Chain Header</a> name: the string literal <b><code>x5c</code></b>
|
||||||
*
|
*
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #getX509Chain()}
|
* @deprecated since 0.12.0 in favor of {@link #getX509Chain()}
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
String X509_CERT_CHAIN = "x5c";
|
String X509_CERT_CHAIN = "x5c";
|
||||||
|
@ -73,7 +73,7 @@ public interface JwsHeader extends ProtectedHeader {
|
||||||
/**
|
/**
|
||||||
* JWS <a href="https://tools.ietf.org/html/rfc7516#section-4.1.7">X.509 Certificate SHA-1 Thumbprint Header</a> name: the string literal <b><code>x5t</code></b>
|
* JWS <a href="https://tools.ietf.org/html/rfc7516#section-4.1.7">X.509 Certificate SHA-1 Thumbprint Header</a> name: the string literal <b><code>x5t</code></b>
|
||||||
*
|
*
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #getX509Sha1Thumbprint()}
|
* @deprecated since 0.12.0 in favor of {@link #getX509Sha1Thumbprint()}
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
String X509_CERT_SHA1_THUMBPRINT = "x5t";
|
String X509_CERT_SHA1_THUMBPRINT = "x5t";
|
||||||
|
@ -81,7 +81,7 @@ public interface JwsHeader extends ProtectedHeader {
|
||||||
/**
|
/**
|
||||||
* JWS <a href="https://tools.ietf.org/html/rfc7516#section-4.1.8">X.509 Certificate SHA-256 Thumbprint Header</a> name: the string literal <b><code>x5t#S256</code></b>
|
* JWS <a href="https://tools.ietf.org/html/rfc7516#section-4.1.8">X.509 Certificate SHA-256 Thumbprint Header</a> name: the string literal <b><code>x5t#S256</code></b>
|
||||||
*
|
*
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #getX509Sha256Thumbprint()}
|
* @deprecated since 0.12.0 in favor of {@link #getX509Sha256Thumbprint()}
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
String X509_CERT_SHA256_THUMBPRINT = "x5t#S256";
|
String X509_CERT_SHA256_THUMBPRINT = "x5t#S256";
|
||||||
|
@ -89,7 +89,7 @@ public interface JwsHeader extends ProtectedHeader {
|
||||||
/**
|
/**
|
||||||
* JWS <a href="https://tools.ietf.org/html/rfc7516#section-4.1.11">Critical Header</a> name: the string literal <b><code>crit</code></b>
|
* JWS <a href="https://tools.ietf.org/html/rfc7516#section-4.1.11">Critical Header</a> name: the string literal <b><code>crit</code></b>
|
||||||
*
|
*
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #getCritical()}
|
* @deprecated since 0.12.0 in favor of {@link #getCritical()}
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
String CRITICAL = "crit";
|
String CRITICAL = "crit";
|
||||||
|
|
|
@ -29,7 +29,7 @@ public interface Jwt<H extends Header, P> {
|
||||||
* signed or encrypted) and rejects all others with an {@link UnsupportedJwtException}.
|
* signed or encrypted) and rejects all others with an {@link UnsupportedJwtException}.
|
||||||
*
|
*
|
||||||
* @see SupportedJwtVisitor#onUnsecuredContent(Jwt)
|
* @see SupportedJwtVisitor#onUnsecuredContent(Jwt)
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("UnnecessaryModifier")
|
@SuppressWarnings("UnnecessaryModifier")
|
||||||
public static final JwtVisitor<Jwt<Header, byte[]>> UNSECURED_CONTENT = new SupportedJwtVisitor<Jwt<Header, byte[]>>() {
|
public static final JwtVisitor<Jwt<Header, byte[]>> UNSECURED_CONTENT = new SupportedJwtVisitor<Jwt<Header, byte[]>>() {
|
||||||
|
@ -44,7 +44,7 @@ public interface Jwt<H extends Header, P> {
|
||||||
* cryptographically signed or encrypted) and rejects all others with an {@link UnsupportedJwtException}.
|
* cryptographically signed or encrypted) and rejects all others with an {@link UnsupportedJwtException}.
|
||||||
*
|
*
|
||||||
* @see SupportedJwtVisitor#onUnsecuredClaims(Jwt)
|
* @see SupportedJwtVisitor#onUnsecuredClaims(Jwt)
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("UnnecessaryModifier")
|
@SuppressWarnings("UnnecessaryModifier")
|
||||||
public static final JwtVisitor<Jwt<Header, Claims>> UNSECURED_CLAIMS = new SupportedJwtVisitor<Jwt<Header, Claims>>() {
|
public static final JwtVisitor<Jwt<Header, Claims>> UNSECURED_CLAIMS = new SupportedJwtVisitor<Jwt<Header, Claims>>() {
|
||||||
|
@ -66,7 +66,7 @@ public interface Jwt<H extends Header, P> {
|
||||||
* {@link #getPayload()} instead, as this method will be removed prior to the 1.0 release.
|
* {@link #getPayload()} instead, as this method will be removed prior to the 1.0 release.
|
||||||
*
|
*
|
||||||
* @return the JWT payload, either a {@code byte[]} or a {@code Claims} instance.
|
* @return the JWT payload, either a {@code byte[]} or a {@code Claims} instance.
|
||||||
* @deprecated since JJWT_RELEASE_VERSION because it has been renamed to {@link #getPayload()}. 'Payload' (not
|
* @deprecated since 0.12.0 because it has been renamed to {@link #getPayload()}. 'Payload' (not
|
||||||
* body) is what the JWT specifications call this property, so it has been renamed to reflect the correct JWT
|
* body) is what the JWT specifications call this property, so it has been renamed to reflect the correct JWT
|
||||||
* nomenclature/taxonomy.
|
* nomenclature/taxonomy.
|
||||||
*/
|
*/
|
||||||
|
@ -81,7 +81,7 @@ public interface Jwt<H extends Header, P> {
|
||||||
* the final content type as desired.
|
* the final content type as desired.
|
||||||
*
|
*
|
||||||
* @return the JWT payload, either a {@code byte[]} or a {@code Claims} instance.
|
* @return the JWT payload, either a {@code byte[]} or a {@code Claims} instance.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
P getPayload();
|
P getPayload();
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
|
||||||
* @param provider the JCA Provider to use during cryptographic signing or encryption operations, or {@code null} if the
|
* @param provider the JCA Provider to use during cryptographic signing or encryption operations, or {@code null} if the
|
||||||
* JCA subsystem preferred provider should be used.
|
* JCA subsystem preferred provider should be used.
|
||||||
* @return the builder for method chaining.
|
* @return the builder for method chaining.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
JwtBuilder provider(Provider provider);
|
JwtBuilder provider(Provider provider);
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
|
||||||
* @param secureRandom the {@link SecureRandom} to use during cryptographic signing or encryption operations, or
|
* @param secureRandom the {@link SecureRandom} to use during cryptographic signing or encryption operations, or
|
||||||
* {@code null} if a default {@link SecureRandom} should be used.
|
* {@code null} if a default {@link SecureRandom} should be used.
|
||||||
* @return the builder for method chaining.
|
* @return the builder for method chaining.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
JwtBuilder random(SecureRandom secureRandom);
|
JwtBuilder random(SecureRandom secureRandom);
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
|
||||||
* .compact();</pre></blockquote>
|
* .compact();</pre></blockquote>
|
||||||
*
|
*
|
||||||
* @return the {@link BuilderHeader} to use for header construction.
|
* @return the {@link BuilderHeader} to use for header construction.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
BuilderHeader header();
|
BuilderHeader header();
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
|
||||||
*
|
*
|
||||||
* @param map the name/value pairs to set as (and potentially replace) the constructed JWT header.
|
* @param map the name/value pairs to set as (and potentially replace) the constructed JWT header.
|
||||||
* @return the builder for method chaining.
|
* @return the builder for method chaining.
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of
|
* @deprecated since 0.12.0 in favor of
|
||||||
* <code>{@link #header()}.{@link MapMutator#empty() empty()}.{@link MapMutator#add(Map) add(map)}.{@link BuilderHeader#and() and()}</code>
|
* <code>{@link #header()}.{@link MapMutator#empty() empty()}.{@link MapMutator#add(Map) add(map)}.{@link BuilderHeader#and() and()}</code>
|
||||||
* (to replace all header parameters) or
|
* (to replace all header parameters) or
|
||||||
* <code>{@link #header()}.{@link MapMutator#add(Map) add(map)}.{@link BuilderHeader#and() and()}</code>
|
* <code>{@link #header()}.{@link MapMutator#add(Map) add(map)}.{@link BuilderHeader#and() and()}</code>
|
||||||
|
@ -126,7 +126,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
|
||||||
*
|
*
|
||||||
* @param params the header name/value pairs to append to the header.
|
* @param params the header name/value pairs to append to the header.
|
||||||
* @return the builder for method chaining.
|
* @return the builder for method chaining.
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of
|
* @deprecated since 0.12.0 in favor of
|
||||||
* <code>{@link #header()}.{@link MapMutator#add(Map) add(map)}.{@link BuilderHeader#and() and()}</code>.
|
* <code>{@link #header()}.{@link MapMutator#add(Map) add(map)}.{@link BuilderHeader#and() and()}</code>.
|
||||||
* This method will be removed before the 1.0 release.
|
* This method will be removed before the 1.0 release.
|
||||||
*/
|
*/
|
||||||
|
@ -143,7 +143,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
|
||||||
* @param name the header parameter name
|
* @param name the header parameter name
|
||||||
* @param value the header parameter value
|
* @param value the header parameter value
|
||||||
* @return the builder for method chaining.
|
* @return the builder for method chaining.
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of <code>
|
* @deprecated since 0.12.0 in favor of <code>
|
||||||
* {@link #header()}.{@link MapMutator#add(Object, Object) add(name, value)}.{@link BuilderHeader#and() and()}</code>.
|
* {@link #header()}.{@link MapMutator#add(Object, Object) add(name, value)}.{@link BuilderHeader#and() and()}</code>.
|
||||||
* This method will be removed before the 1.0 release.
|
* This method will be removed before the 1.0 release.
|
||||||
*/
|
*/
|
||||||
|
@ -152,7 +152,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
|
||||||
JwtBuilder setHeaderParam(String name, Object value);
|
JwtBuilder setHeaderParam(String name, Object value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Since JJWT JJWT_RELEASE_VERSION, this is an alias for {@link #content(String)}. This method will be removed
|
* Since JJWT 0.12.0, this is an alias for {@link #content(String)}. This method will be removed
|
||||||
* before the 1.0 release.
|
* before the 1.0 release.
|
||||||
*
|
*
|
||||||
* @param payload the string used to set UTF-8-encoded bytes as the JWT payload.
|
* @param payload the string used to set UTF-8-encoded bytes as the JWT payload.
|
||||||
|
@ -191,7 +191,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
|
||||||
* @see #content(String, String)
|
* @see #content(String, String)
|
||||||
* @see #content(byte[], String)
|
* @see #content(byte[], String)
|
||||||
* @see #content(InputStream, String)
|
* @see #content(InputStream, String)
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
JwtBuilder content(String content);
|
JwtBuilder content(String content);
|
||||||
|
|
||||||
|
@ -222,7 +222,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
|
||||||
* @param content the content byte array to use as the JWT payload
|
* @param content the content byte array to use as the JWT payload
|
||||||
* @return the builder for method chaining.
|
* @return the builder for method chaining.
|
||||||
* @see #content(byte[], String)
|
* @see #content(byte[], String)
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
JwtBuilder content(byte[] content);
|
JwtBuilder content(byte[] content);
|
||||||
|
|
||||||
|
@ -250,7 +250,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
|
||||||
* @param in the input stream containing the bytes to use as the JWT payload
|
* @param in the input stream containing the bytes to use as the JWT payload
|
||||||
* @return the builder for method chaining.
|
* @return the builder for method chaining.
|
||||||
* @see #content(byte[], String)
|
* @see #content(byte[], String)
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
JwtBuilder content(InputStream in);
|
JwtBuilder content(InputStream in);
|
||||||
|
|
||||||
|
@ -297,7 +297,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
|
||||||
* @param cty the content type (media type) identifier attributed to the byte array. Cannot be null or empty.
|
* @param cty the content type (media type) identifier attributed to the byte array. Cannot be null or empty.
|
||||||
* @return the builder for method chaining.
|
* @return the builder for method chaining.
|
||||||
* @throws IllegalArgumentException if either {@code content} or {@code cty} are null or empty.
|
* @throws IllegalArgumentException if either {@code content} or {@code cty} are null or empty.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
JwtBuilder content(String content, String cty) throws IllegalArgumentException;
|
JwtBuilder content(String content, String cty) throws IllegalArgumentException;
|
||||||
|
|
||||||
|
@ -343,7 +343,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
|
||||||
* @param cty the content type (media type) identifier attributed to the byte array. Cannot be null or empty.
|
* @param cty the content type (media type) identifier attributed to the byte array. Cannot be null or empty.
|
||||||
* @return the builder for method chaining.
|
* @return the builder for method chaining.
|
||||||
* @throws IllegalArgumentException if either {@code content} or {@code cty} are null or empty.
|
* @throws IllegalArgumentException if either {@code content} or {@code cty} are null or empty.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
JwtBuilder content(byte[] content, String cty) throws IllegalArgumentException;
|
JwtBuilder content(byte[] content, String cty) throws IllegalArgumentException;
|
||||||
|
|
||||||
|
@ -390,7 +390,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
|
||||||
* @param cty the content type (media type) identifier attributed to the byte array. Cannot be null or empty.
|
* @param cty the content type (media type) identifier attributed to the byte array. Cannot be null or empty.
|
||||||
* @return the builder for method chaining.
|
* @return the builder for method chaining.
|
||||||
* @throws IllegalArgumentException if either {@code content} or {@code cty} are null or empty.
|
* @throws IllegalArgumentException if either {@code content} or {@code cty} are null or empty.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
JwtBuilder content(InputStream content, String cty) throws IllegalArgumentException;
|
JwtBuilder content(InputStream content, String cty) throws IllegalArgumentException;
|
||||||
|
|
||||||
|
@ -416,7 +416,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
|
||||||
* .compact();</pre></blockquote>
|
* .compact();</pre></blockquote>
|
||||||
*
|
*
|
||||||
* @return the {@link BuilderClaims} to use for Claims construction.
|
* @return the {@link BuilderClaims} to use for Claims construction.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
BuilderClaims claims();
|
BuilderClaims claims();
|
||||||
|
|
||||||
|
@ -434,7 +434,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
|
||||||
* @see #content(String)
|
* @see #content(String)
|
||||||
* @see #content(byte[])
|
* @see #content(byte[])
|
||||||
* @see #content(InputStream)
|
* @see #content(InputStream)
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of using the {@link #claims()} builder.
|
* @deprecated since 0.12.0 in favor of using the {@link #claims()} builder.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("DeprecatedIsStillUsed")
|
@SuppressWarnings("DeprecatedIsStillUsed")
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -451,7 +451,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
|
||||||
* @param claims the JWT Claims to be added to the JWT payload.
|
* @param claims the JWT Claims to be added to the JWT payload.
|
||||||
* @return the builder for method chaining.
|
* @return the builder for method chaining.
|
||||||
* @since 0.8
|
* @since 0.8
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of
|
* @deprecated since 0.12.0 in favor of
|
||||||
* <code>{@link #claims()}.{@link BuilderClaims#add(Map) add(Map)}.{@link BuilderClaims#and() and()}</code>.
|
* <code>{@link #claims()}.{@link BuilderClaims#add(Map) add(Map)}.{@link BuilderClaims#and() and()}</code>.
|
||||||
* This method will be removed before the 1.0 release.
|
* This method will be removed before the 1.0 release.
|
||||||
*/
|
*/
|
||||||
|
@ -483,7 +483,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
|
||||||
*
|
*
|
||||||
* @param claims the JWT Claims to be added to the JWT payload.
|
* @param claims the JWT Claims to be added to the JWT payload.
|
||||||
* @return the builder instance for method chaining
|
* @return the builder instance for method chaining
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
JwtBuilder claims(Map<String, ?> claims);
|
JwtBuilder claims(Map<String, ?> claims);
|
||||||
|
|
||||||
|
@ -815,7 +815,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
|
||||||
/**
|
/**
|
||||||
* <p><b>Deprecation Notice</b></p>
|
* <p><b>Deprecation Notice</b></p>
|
||||||
*
|
*
|
||||||
* <p><b>This has been deprecated since JJWT_RELEASE_VERSION. Use
|
* <p><b>This has been deprecated since 0.12.0. Use
|
||||||
* {@link #signWith(Key, SecureDigestAlgorithm)} instead</b>. Standard JWA algorithms
|
* {@link #signWith(Key, SecureDigestAlgorithm)} instead</b>. Standard JWA algorithms
|
||||||
* are represented as instances of this new interface in the {@link Jwts.SIG}
|
* are represented as instances of this new interface in the {@link Jwts.SIG}
|
||||||
* algorithm registry.</p>
|
* algorithm registry.</p>
|
||||||
|
@ -833,7 +833,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
|
||||||
* the specified algorithm.
|
* the specified algorithm.
|
||||||
* @see #signWith(Key)
|
* @see #signWith(Key)
|
||||||
* @since 0.10.0
|
* @since 0.10.0
|
||||||
* @deprecated since JJWT_RELEASE_VERSION to use the more flexible {@link #signWith(Key, SecureDigestAlgorithm)}.
|
* @deprecated since 0.12.0 to use the more flexible {@link #signWith(Key, SecureDigestAlgorithm)}.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
JwtBuilder signWith(Key key, SignatureAlgorithm alg) throws InvalidKeyException;
|
JwtBuilder signWith(Key key, SignatureAlgorithm alg) throws InvalidKeyException;
|
||||||
|
@ -856,7 +856,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
|
||||||
* the specified algorithm.
|
* the specified algorithm.
|
||||||
* @see #signWith(Key)
|
* @see #signWith(Key)
|
||||||
* @see Jwts.SIG
|
* @see Jwts.SIG
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
<K extends Key> JwtBuilder signWith(K key, SecureDigestAlgorithm<? super K, ?> alg) throws InvalidKeyException;
|
<K extends Key> JwtBuilder signWith(K key, SecureDigestAlgorithm<? super K, ?> alg) throws InvalidKeyException;
|
||||||
|
|
||||||
|
@ -943,7 +943,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
|
||||||
* @param alg implementation of the {@link CompressionAlgorithm} to be used.
|
* @param alg implementation of the {@link CompressionAlgorithm} to be used.
|
||||||
* @return the builder for method chaining.
|
* @return the builder for method chaining.
|
||||||
* @see Jwts.ZIP
|
* @see Jwts.ZIP
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
JwtBuilder compressWith(CompressionAlgorithm alg);
|
JwtBuilder compressWith(CompressionAlgorithm alg);
|
||||||
|
|
||||||
|
@ -957,7 +957,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
|
||||||
* @return the builder for method chaining.
|
* @return the builder for method chaining.
|
||||||
* @see #b64Url(Encoder)
|
* @see #b64Url(Encoder)
|
||||||
* @since 0.10.0
|
* @since 0.10.0
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #b64Url(Encoder)}.
|
* @deprecated since 0.12.0 in favor of {@link #b64Url(Encoder)}.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("DeprecatedIsStillUsed")
|
@SuppressWarnings("DeprecatedIsStillUsed")
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -974,7 +974,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
|
||||||
*
|
*
|
||||||
* @param encoder the encoder to use when Base64Url-encoding
|
* @param encoder the encoder to use when Base64Url-encoding
|
||||||
* @return the builder for method chaining.
|
* @return the builder for method chaining.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
JwtBuilder b64Url(Encoder<OutputStream, OutputStream> encoder);
|
JwtBuilder b64Url(Encoder<OutputStream, OutputStream> encoder);
|
||||||
|
|
||||||
|
@ -1003,7 +1003,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
|
||||||
* @param serializer the serializer to use when converting Map objects to JSON strings.
|
* @param serializer the serializer to use when converting Map objects to JSON strings.
|
||||||
* @return the builder for method chaining.
|
* @return the builder for method chaining.
|
||||||
* @since 0.10.0
|
* @since 0.10.0
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #json(Serializer)}
|
* @deprecated since 0.12.0 in favor of {@link #json(Serializer)}
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("DeprecatedIsStillUsed")
|
@SuppressWarnings("DeprecatedIsStillUsed")
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -1019,7 +1019,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
|
||||||
*
|
*
|
||||||
* @param serializer the Serializer to use when converting Map objects to JSON strings.
|
* @param serializer the Serializer to use when converting Map objects to JSON strings.
|
||||||
* @return the builder for method chaining.
|
* @return the builder for method chaining.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
JwtBuilder json(Serializer<Map<String, ?>> serializer);
|
JwtBuilder json(Serializer<Map<String, ?>> serializer);
|
||||||
|
|
||||||
|
@ -1037,7 +1037,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
|
||||||
* Once claims are configured, the associated {@link JwtBuilder} may be obtained with the {@link #and() and()}
|
* Once claims are configured, the associated {@link JwtBuilder} may be obtained with the {@link #and() and()}
|
||||||
* method for continued configuration.
|
* method for continued configuration.
|
||||||
*
|
*
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
interface BuilderClaims extends MapMutator<String, Object, BuilderClaims>, ClaimsMutator<BuilderClaims>,
|
interface BuilderClaims extends MapMutator<String, Object, BuilderClaims>, ClaimsMutator<BuilderClaims>,
|
||||||
Conjunctor<JwtBuilder> {
|
Conjunctor<JwtBuilder> {
|
||||||
|
@ -1048,7 +1048,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
|
||||||
* standard JWT, JWS and JWE header parameters. Once header parameters are configured, the associated
|
* standard JWT, JWS and JWE header parameters. Once header parameters are configured, the associated
|
||||||
* {@link JwtBuilder} may be obtained with the {@link #and() and()} method for continued configuration.
|
* {@link JwtBuilder} may be obtained with the {@link #and() and()} method for continued configuration.
|
||||||
*
|
*
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
interface BuilderHeader extends JweHeaderMutator<BuilderHeader>, X509Builder<BuilderHeader>,
|
interface BuilderHeader extends JweHeaderMutator<BuilderHeader>, X509Builder<BuilderHeader>,
|
||||||
Conjunctor<JwtBuilder> {
|
Conjunctor<JwtBuilder> {
|
||||||
|
|
|
@ -21,7 +21,7 @@ package io.jsonwebtoken;
|
||||||
*
|
*
|
||||||
* @param <T> the type of object to return to the parser caller after handling the parsed JWT.
|
* @param <T> the type of object to return to the parser caller after handling the parsed JWT.
|
||||||
* @since 0.2
|
* @since 0.2
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of calling {@link Jwt#accept(JwtVisitor)}.
|
* @deprecated since 0.12.0 in favor of calling {@link Jwt#accept(JwtVisitor)}.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("DeprecatedIsStillUsed")
|
@SuppressWarnings("DeprecatedIsStillUsed")
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -83,7 +83,7 @@ public interface JwtHandler<T> extends JwtVisitor<T> {
|
||||||
*
|
*
|
||||||
* @param jwe the parsed content jwe
|
* @param jwe the parsed content jwe
|
||||||
* @return any object to be used after inspecting the JWE, or {@code null} if no return value is necessary.
|
* @return any object to be used after inspecting the JWE, or {@code null} if no return value is necessary.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
T onContentJwe(Jwe<byte[]> jwe);
|
T onContentJwe(Jwe<byte[]> jwe);
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ public interface JwtHandler<T> extends JwtVisitor<T> {
|
||||||
*
|
*
|
||||||
* @param jwe the parsed claims jwe
|
* @param jwe the parsed claims jwe
|
||||||
* @return any object to be used after inspecting the JWE, or {@code null} if no return value is necessary.
|
* @return any object to be used after inspecting the JWE, or {@code null} if no return value is necessary.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
T onClaimsJwe(Jwe<Claims> jwe);
|
T onClaimsJwe(Jwe<Claims> jwe);
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ public interface JwtParser extends Parser<Jwt<?, ?>> {
|
||||||
SecurityException, IllegalArgumentException;
|
SecurityException, IllegalArgumentException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deprecated since JJWT_RELEASE_VERSION in favor of calling any {@code parse*} method immediately
|
* Deprecated since 0.12.0 in favor of calling any {@code parse*} method immediately
|
||||||
* followed by invoking the parsed JWT's {@link Jwt#accept(JwtVisitor) accept} method with your preferred visitor. For
|
* followed by invoking the parsed JWT's {@link Jwt#accept(JwtVisitor) accept} method with your preferred visitor. For
|
||||||
* example:
|
* example:
|
||||||
*
|
*
|
||||||
|
@ -107,7 +107,7 @@ public interface JwtParser extends Parser<Jwt<?, ?>> {
|
||||||
* {@code handler} is {@code null}.
|
* {@code handler} is {@code null}.
|
||||||
* @see Jwt#accept(JwtVisitor)
|
* @see Jwt#accept(JwtVisitor)
|
||||||
* @since 0.2
|
* @since 0.2
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of
|
* @deprecated since 0.12.0 in favor of
|
||||||
* <code>{@link #parse(CharSequence)}.{@link Jwt#accept(JwtVisitor) accept}({@link JwtVisitor visitor});</code>
|
* <code>{@link #parse(CharSequence)}.{@link Jwt#accept(JwtVisitor) accept}({@link JwtVisitor visitor});</code>
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -115,7 +115,7 @@ public interface JwtParser extends Parser<Jwt<?, ?>> {
|
||||||
MalformedJwtException, SignatureException, SecurityException, IllegalArgumentException;
|
MalformedJwtException, SignatureException, SecurityException, IllegalArgumentException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deprecated since JJWT_RELEASE_VERSION in favor of {@link #parseUnsecuredContent(CharSequence)}.
|
* Deprecated since 0.12.0 in favor of {@link #parseUnsecuredContent(CharSequence)}.
|
||||||
*
|
*
|
||||||
* <p>This method will be removed before the 1.0 release.</p>
|
* <p>This method will be removed before the 1.0 release.</p>
|
||||||
*
|
*
|
||||||
|
@ -129,7 +129,7 @@ public interface JwtParser extends Parser<Jwt<?, ?>> {
|
||||||
* @see #parseUnsecuredContent(CharSequence)
|
* @see #parseUnsecuredContent(CharSequence)
|
||||||
* @see Jwt#accept(JwtVisitor)
|
* @see Jwt#accept(JwtVisitor)
|
||||||
* @since 0.2
|
* @since 0.2
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #parseUnsecuredContent(CharSequence)}.
|
* @deprecated since 0.12.0 in favor of {@link #parseUnsecuredContent(CharSequence)}.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("DeprecatedIsStillUsed")
|
@SuppressWarnings("DeprecatedIsStillUsed")
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -137,7 +137,7 @@ public interface JwtParser extends Parser<Jwt<?, ?>> {
|
||||||
SignatureException, SecurityException, IllegalArgumentException;
|
SignatureException, SecurityException, IllegalArgumentException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deprecated since JJWT_RELEASE_VERSION in favor of {@link #parseUnsecuredClaims(CharSequence)}.
|
* Deprecated since 0.12.0 in favor of {@link #parseUnsecuredClaims(CharSequence)}.
|
||||||
*
|
*
|
||||||
* <p>This method will be removed before the 1.0 release.</p>
|
* <p>This method will be removed before the 1.0 release.</p>
|
||||||
*
|
*
|
||||||
|
@ -151,7 +151,7 @@ public interface JwtParser extends Parser<Jwt<?, ?>> {
|
||||||
* @see #parseUnsecuredClaims(CharSequence)
|
* @see #parseUnsecuredClaims(CharSequence)
|
||||||
* @see Jwt#accept(JwtVisitor)
|
* @see Jwt#accept(JwtVisitor)
|
||||||
* @since 0.2
|
* @since 0.2
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #parseUnsecuredClaims(CharSequence)}.
|
* @deprecated since 0.12.0 in favor of {@link #parseUnsecuredClaims(CharSequence)}.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("DeprecatedIsStillUsed")
|
@SuppressWarnings("DeprecatedIsStillUsed")
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -159,7 +159,7 @@ public interface JwtParser extends Parser<Jwt<?, ?>> {
|
||||||
MalformedJwtException, SignatureException, SecurityException, IllegalArgumentException;
|
MalformedJwtException, SignatureException, SecurityException, IllegalArgumentException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deprecated since JJWT_RELEASE_VERSION in favor of {@link #parseSignedContent(CharSequence)}.
|
* Deprecated since 0.12.0 in favor of {@link #parseSignedContent(CharSequence)}.
|
||||||
*
|
*
|
||||||
* <p>This method will be removed before the 1.0 release.</p>
|
* <p>This method will be removed before the 1.0 release.</p>
|
||||||
*
|
*
|
||||||
|
@ -174,7 +174,7 @@ public interface JwtParser extends Parser<Jwt<?, ?>> {
|
||||||
* @see #parseEncryptedContent(CharSequence)
|
* @see #parseEncryptedContent(CharSequence)
|
||||||
* @see #parse(CharSequence)
|
* @see #parse(CharSequence)
|
||||||
* @since 0.2
|
* @since 0.2
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #parseSignedContent(CharSequence)}.
|
* @deprecated since 0.12.0 in favor of {@link #parseSignedContent(CharSequence)}.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("DeprecatedIsStillUsed")
|
@SuppressWarnings("DeprecatedIsStillUsed")
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -182,7 +182,7 @@ public interface JwtParser extends Parser<Jwt<?, ?>> {
|
||||||
SecurityException, IllegalArgumentException;
|
SecurityException, IllegalArgumentException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deprecated since JJWT_RELEASE_VERSION in favor of {@link #parseSignedClaims(CharSequence)}.
|
* Deprecated since 0.12.0 in favor of {@link #parseSignedClaims(CharSequence)}.
|
||||||
*
|
*
|
||||||
* @param jws a compact Claims JWS string.
|
* @param jws a compact Claims JWS string.
|
||||||
* @return the parsed and validated Claims JWS
|
* @return the parsed and validated Claims JWS
|
||||||
|
@ -197,7 +197,7 @@ public interface JwtParser extends Parser<Jwt<?, ?>> {
|
||||||
* @see #parseEncryptedClaims(CharSequence)
|
* @see #parseEncryptedClaims(CharSequence)
|
||||||
* @see #parse(CharSequence)
|
* @see #parse(CharSequence)
|
||||||
* @since 0.2
|
* @since 0.2
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #parseSignedClaims(CharSequence)}.
|
* @deprecated since 0.12.0 in favor of {@link #parseSignedClaims(CharSequence)}.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("DeprecatedIsStillUsed")
|
@SuppressWarnings("DeprecatedIsStillUsed")
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -222,7 +222,7 @@ public interface JwtParser extends Parser<Jwt<?, ?>> {
|
||||||
* @throws IllegalArgumentException if the {@code jwt} string is {@code null} or empty or only whitespace
|
* @throws IllegalArgumentException if the {@code jwt} string is {@code null} or empty or only whitespace
|
||||||
* @see #parse(CharSequence)
|
* @see #parse(CharSequence)
|
||||||
* @see Jwt#accept(JwtVisitor)
|
* @see Jwt#accept(JwtVisitor)
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
Jwt<Header, byte[]> parseUnsecuredContent(CharSequence jwt) throws JwtException, IllegalArgumentException;
|
Jwt<Header, byte[]> parseUnsecuredContent(CharSequence jwt) throws JwtException, IllegalArgumentException;
|
||||||
|
|
||||||
|
@ -241,7 +241,7 @@ public interface JwtParser extends Parser<Jwt<?, ?>> {
|
||||||
* @throws IllegalArgumentException if the {@code jwt} string is {@code null} or empty or only whitespace
|
* @throws IllegalArgumentException if the {@code jwt} string is {@code null} or empty or only whitespace
|
||||||
* @see #parse(CharSequence)
|
* @see #parse(CharSequence)
|
||||||
* @see Jwt#accept(JwtVisitor)
|
* @see Jwt#accept(JwtVisitor)
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
Jwt<Header, Claims> parseUnsecuredClaims(CharSequence jwt) throws JwtException, IllegalArgumentException;
|
Jwt<Header, Claims> parseUnsecuredClaims(CharSequence jwt) throws JwtException, IllegalArgumentException;
|
||||||
|
|
||||||
|
@ -263,7 +263,7 @@ public interface JwtParser extends Parser<Jwt<?, ?>> {
|
||||||
* @throws IllegalArgumentException if the {@code jws} string is {@code null} or empty or only whitespace
|
* @throws IllegalArgumentException if the {@code jws} string is {@code null} or empty or only whitespace
|
||||||
* @see #parse(CharSequence)
|
* @see #parse(CharSequence)
|
||||||
* @see Jwt#accept(JwtVisitor)
|
* @see Jwt#accept(JwtVisitor)
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
Jws<byte[]> parseSignedContent(CharSequence jws) throws JwtException, IllegalArgumentException;
|
Jws<byte[]> parseSignedContent(CharSequence jws) throws JwtException, IllegalArgumentException;
|
||||||
|
|
||||||
|
@ -282,7 +282,7 @@ public interface JwtParser extends Parser<Jwt<?, ?>> {
|
||||||
* @param jws the Unencoded Payload JWS to parse.
|
* @param jws the Unencoded Payload JWS to parse.
|
||||||
* @param unencodedPayload the JWS's associated required unencoded payload used for signature verification.
|
* @param unencodedPayload the JWS's associated required unencoded payload used for signature verification.
|
||||||
* @return the parsed Unencoded Payload.
|
* @return the parsed Unencoded Payload.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
Jws<byte[]> parseSignedContent(CharSequence jws, byte[] unencodedPayload);
|
Jws<byte[]> parseSignedContent(CharSequence jws, byte[] unencodedPayload);
|
||||||
|
|
||||||
|
@ -307,7 +307,7 @@ public interface JwtParser extends Parser<Jwt<?, ?>> {
|
||||||
* @param jws the Unencoded Payload JWS to parse.
|
* @param jws the Unencoded Payload JWS to parse.
|
||||||
* @param unencodedPayload the JWS's associated required unencoded payload used for signature verification.
|
* @param unencodedPayload the JWS's associated required unencoded payload used for signature verification.
|
||||||
* @return the parsed Unencoded Payload.
|
* @return the parsed Unencoded Payload.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
Jws<byte[]> parseSignedContent(CharSequence jws, InputStream unencodedPayload);
|
Jws<byte[]> parseSignedContent(CharSequence jws, InputStream unencodedPayload);
|
||||||
|
|
||||||
|
@ -326,7 +326,7 @@ public interface JwtParser extends Parser<Jwt<?, ?>> {
|
||||||
* @throws IllegalArgumentException if the {@code jwt} string is {@code null} or empty or only whitespace
|
* @throws IllegalArgumentException if the {@code jwt} string is {@code null} or empty or only whitespace
|
||||||
* @see #parse(CharSequence)
|
* @see #parse(CharSequence)
|
||||||
* @see Jwt#accept(JwtVisitor)
|
* @see Jwt#accept(JwtVisitor)
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
Jws<Claims> parseSignedClaims(CharSequence jws) throws JwtException, IllegalArgumentException;
|
Jws<Claims> parseSignedClaims(CharSequence jws) throws JwtException, IllegalArgumentException;
|
||||||
|
|
||||||
|
@ -347,7 +347,7 @@ public interface JwtParser extends Parser<Jwt<?, ?>> {
|
||||||
* @return the parsed and validated Claims JWS.
|
* @return the parsed and validated Claims JWS.
|
||||||
* @throws JwtException if parsing, signature verification, or JWT validation fails.
|
* @throws JwtException if parsing, signature verification, or JWT validation fails.
|
||||||
* @throws IllegalArgumentException if either the {@code jws} or {@code unencodedPayload} are null or empty.
|
* @throws IllegalArgumentException if either the {@code jws} or {@code unencodedPayload} are null or empty.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
Jws<Claims> parseSignedClaims(CharSequence jws, byte[] unencodedPayload) throws JwtException, IllegalArgumentException;
|
Jws<Claims> parseSignedClaims(CharSequence jws, byte[] unencodedPayload) throws JwtException, IllegalArgumentException;
|
||||||
|
|
||||||
|
@ -375,7 +375,7 @@ public interface JwtParser extends Parser<Jwt<?, ?>> {
|
||||||
* @return the parsed and validated Claims JWS.
|
* @return the parsed and validated Claims JWS.
|
||||||
* @throws JwtException if parsing, signature verification, or JWT validation fails.
|
* @throws JwtException if parsing, signature verification, or JWT validation fails.
|
||||||
* @throws IllegalArgumentException if either the {@code jws} or {@code unencodedPayload} are null or empty.
|
* @throws IllegalArgumentException if either the {@code jws} or {@code unencodedPayload} are null or empty.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
Jws<Claims> parseSignedClaims(CharSequence jws, InputStream unencodedPayload) throws JwtException, IllegalArgumentException;
|
Jws<Claims> parseSignedClaims(CharSequence jws, InputStream unencodedPayload) throws JwtException, IllegalArgumentException;
|
||||||
|
|
||||||
|
@ -397,7 +397,7 @@ public interface JwtParser extends Parser<Jwt<?, ?>> {
|
||||||
* @throws IllegalArgumentException if the {@code jwe} string is {@code null} or empty or only whitespace
|
* @throws IllegalArgumentException if the {@code jwe} string is {@code null} or empty or only whitespace
|
||||||
* @see #parse(CharSequence)
|
* @see #parse(CharSequence)
|
||||||
* @see Jwt#accept(JwtVisitor)
|
* @see Jwt#accept(JwtVisitor)
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
Jwe<byte[]> parseEncryptedContent(CharSequence jwe) throws JwtException, IllegalArgumentException;
|
Jwe<byte[]> parseEncryptedContent(CharSequence jwe) throws JwtException, IllegalArgumentException;
|
||||||
|
|
||||||
|
@ -416,7 +416,7 @@ public interface JwtParser extends Parser<Jwt<?, ?>> {
|
||||||
* @throws IllegalArgumentException if the {@code jwe} string is {@code null} or empty or only whitespace
|
* @throws IllegalArgumentException if the {@code jwe} string is {@code null} or empty or only whitespace
|
||||||
* @see #parse(CharSequence)
|
* @see #parse(CharSequence)
|
||||||
* @see Jwt#accept(JwtVisitor)
|
* @see Jwt#accept(JwtVisitor)
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
Jwe<Claims> parseEncryptedClaims(CharSequence jwe) throws JwtException, IllegalArgumentException;
|
Jwe<Claims> parseEncryptedClaims(CharSequence jwe) throws JwtException, IllegalArgumentException;
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,7 @@ public interface JwtParserBuilder extends Builder<JwtParser> {
|
||||||
* @see <a href="https://www.rfc-editor.org/rfc/rfc7518.html#section-3.6">Using the Algorithm "none"</a>
|
* @see <a href="https://www.rfc-editor.org/rfc/rfc7518.html#section-3.6">Using the Algorithm "none"</a>
|
||||||
* @see Jwts.SIG#NONE
|
* @see Jwts.SIG#NONE
|
||||||
* @see #unsecuredDecompression()
|
* @see #unsecuredDecompression()
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
JwtParserBuilder unsecured();
|
JwtParserBuilder unsecured();
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ public interface JwtParserBuilder extends Builder<JwtParser> {
|
||||||
* Compression Hornet’s Nest: A Security Study of Data Compression in Network Services</a>
|
* Compression Hornet’s Nest: A Security Study of Data Compression in Network Services</a>
|
||||||
* @see Jwts.SIG#NONE
|
* @see Jwts.SIG#NONE
|
||||||
* @see #unsecured()
|
* @see #unsecured()
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
JwtParserBuilder unsecuredDecompression();
|
JwtParserBuilder unsecuredDecompression();
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ public interface JwtParserBuilder extends Builder<JwtParser> {
|
||||||
*
|
*
|
||||||
* @return the {@link NestedCollection} to use for {@code crit} configuration.
|
* @return the {@link NestedCollection} to use for {@code crit} configuration.
|
||||||
* @see ProtectedHeader#getCritical()
|
* @see ProtectedHeader#getCritical()
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
NestedCollection<String, JwtParserBuilder> critical();
|
NestedCollection<String, JwtParserBuilder> critical();
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ public interface JwtParserBuilder extends Builder<JwtParser> {
|
||||||
* @param provider the JCA Provider to use during cryptographic signature and decryption operations, or {@code null}
|
* @param provider the JCA Provider to use during cryptographic signature and decryption operations, or {@code null}
|
||||||
* if the JCA subsystem preferred provider should be used.
|
* if the JCA subsystem preferred provider should be used.
|
||||||
* @return the builder for method chaining.
|
* @return the builder for method chaining.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
JwtParserBuilder provider(Provider provider);
|
JwtParserBuilder provider(Provider provider);
|
||||||
|
|
||||||
|
@ -227,7 +227,7 @@ public interface JwtParserBuilder extends Builder<JwtParser> {
|
||||||
*
|
*
|
||||||
* @param clock a {@code Clock} object to return the timestamp to use when validating the parsed JWT.
|
* @param clock a {@code Clock} object to return the timestamp to use when validating the parsed JWT.
|
||||||
* @return the parser builder for method chaining.
|
* @return the parser builder for method chaining.
|
||||||
* @deprecated since JJWT_RELEASE_VERSION for the more modern builder-style named {@link #clock(Clock)} method.
|
* @deprecated since 0.12.0 for the more modern builder-style named {@link #clock(Clock)} method.
|
||||||
* This method will be removed before the JJWT 1.0 release.
|
* This method will be removed before the JJWT 1.0 release.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -251,7 +251,7 @@ public interface JwtParserBuilder extends Builder<JwtParser> {
|
||||||
* @throws IllegalArgumentException if {@code seconds} is a value greater than {@code Long.MAX_VALUE / 1000} as
|
* @throws IllegalArgumentException if {@code seconds} is a value greater than {@code Long.MAX_VALUE / 1000} as
|
||||||
* any such value would cause numeric overflow when multiplying by 1000 to obtain
|
* any such value would cause numeric overflow when multiplying by 1000 to obtain
|
||||||
* a millisecond value.
|
* a millisecond value.
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of the shorter and more modern builder-style named
|
* @deprecated since 0.12.0 in favor of the shorter and more modern builder-style named
|
||||||
* {@link #clockSkewSeconds(long)}. This method will be removed before the JJWT 1.0 release.
|
* {@link #clockSkewSeconds(long)}. This method will be removed before the JJWT 1.0 release.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -272,7 +272,7 @@ public interface JwtParserBuilder extends Builder<JwtParser> {
|
||||||
/**
|
/**
|
||||||
* <p><b>Deprecation Notice</b></p>
|
* <p><b>Deprecation Notice</b></p>
|
||||||
*
|
*
|
||||||
* <p>This method has been deprecated since JJWT_RELEASE_VERSION and will be removed before 1.0. It was not
|
* <p>This method has been deprecated since 0.12.0 and will be removed before 1.0. It was not
|
||||||
* readily obvious to many JJWT users that this method was for bytes that pertained <em>only</em> to HMAC
|
* readily obvious to many JJWT users that this method was for bytes that pertained <em>only</em> to HMAC
|
||||||
* {@code SecretKey}s, and could be confused with keys of other types. It is better to obtain a type-safe
|
* {@code SecretKey}s, and could be confused with keys of other types. It is better to obtain a type-safe
|
||||||
* {@link SecretKey} instance and call {@link #verifyWith(SecretKey)} instead.</p>
|
* {@link SecretKey} instance and call {@link #verifyWith(SecretKey)} instead.</p>
|
||||||
|
@ -290,7 +290,7 @@ public interface JwtParserBuilder extends Builder<JwtParser> {
|
||||||
* @param key the algorithm-specific signature verification key used to validate any discovered JWS digital
|
* @param key the algorithm-specific signature verification key used to validate any discovered JWS digital
|
||||||
* signature.
|
* signature.
|
||||||
* @return the parser builder for method chaining.
|
* @return the parser builder for method chaining.
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #verifyWith(SecretKey)} for type safety and name
|
* @deprecated since 0.12.0 in favor of {@link #verifyWith(SecretKey)} for type safety and name
|
||||||
* congruence with the {@link #decryptWith(SecretKey)} method.
|
* congruence with the {@link #decryptWith(SecretKey)} method.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -343,7 +343,7 @@ public interface JwtParserBuilder extends Builder<JwtParser> {
|
||||||
*
|
*
|
||||||
* <p>This method is being renamed to accurately reflect its purpose - the key is not technically a signing key,
|
* <p>This method is being renamed to accurately reflect its purpose - the key is not technically a signing key,
|
||||||
* it is a signature verification key, and the two concepts can be different, especially with asymmetric key
|
* it is a signature verification key, and the two concepts can be different, especially with asymmetric key
|
||||||
* cryptography. The method has been deprecated since JJWT_RELEASE_VERSION in favor of
|
* cryptography. The method has been deprecated since 0.12.0 in favor of
|
||||||
* {@link #verifyWith(SecretKey)} for type safety, to reflect accurate naming of the concept, and for name
|
* {@link #verifyWith(SecretKey)} for type safety, to reflect accurate naming of the concept, and for name
|
||||||
* congruence with the {@link #decryptWith(SecretKey)} method.</p>
|
* congruence with the {@link #decryptWith(SecretKey)} method.</p>
|
||||||
*
|
*
|
||||||
|
@ -352,7 +352,7 @@ public interface JwtParserBuilder extends Builder<JwtParser> {
|
||||||
* @param key the algorithm-specific signature verification key to use to verify all encountered JWS digital
|
* @param key the algorithm-specific signature verification key to use to verify all encountered JWS digital
|
||||||
* signatures.
|
* signatures.
|
||||||
* @return the parser builder for method chaining.
|
* @return the parser builder for method chaining.
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #verifyWith(SecretKey)} for naming congruence with the
|
* @deprecated since 0.12.0 in favor of {@link #verifyWith(SecretKey)} for naming congruence with the
|
||||||
* {@link #decryptWith(SecretKey)} method.
|
* {@link #decryptWith(SecretKey)} method.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -375,7 +375,7 @@ public interface JwtParserBuilder extends Builder<JwtParser> {
|
||||||
* @param key the signature verification key to use to verify all encountered JWS digital signatures.
|
* @param key the signature verification key to use to verify all encountered JWS digital signatures.
|
||||||
* @return the parser builder for method chaining.
|
* @return the parser builder for method chaining.
|
||||||
* @see #verifyWith(PublicKey)
|
* @see #verifyWith(PublicKey)
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
JwtParserBuilder verifyWith(SecretKey key);
|
JwtParserBuilder verifyWith(SecretKey key);
|
||||||
|
|
||||||
|
@ -396,7 +396,7 @@ public interface JwtParserBuilder extends Builder<JwtParser> {
|
||||||
* @param key the signature verification key to use to verify all encountered JWS digital signatures.
|
* @param key the signature verification key to use to verify all encountered JWS digital signatures.
|
||||||
* @return the parser builder for method chaining.
|
* @return the parser builder for method chaining.
|
||||||
* @see #verifyWith(SecretKey)
|
* @see #verifyWith(SecretKey)
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
JwtParserBuilder verifyWith(PublicKey key);
|
JwtParserBuilder verifyWith(PublicKey key);
|
||||||
|
|
||||||
|
@ -418,7 +418,7 @@ public interface JwtParserBuilder extends Builder<JwtParser> {
|
||||||
* @param key the algorithm-specific decryption key to use to decrypt all encountered JWEs.
|
* @param key the algorithm-specific decryption key to use to decrypt all encountered JWEs.
|
||||||
* @return the parser builder for method chaining.
|
* @return the parser builder for method chaining.
|
||||||
* @see #decryptWith(PrivateKey)
|
* @see #decryptWith(PrivateKey)
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
JwtParserBuilder decryptWith(SecretKey key);
|
JwtParserBuilder decryptWith(SecretKey key);
|
||||||
|
|
||||||
|
@ -439,7 +439,7 @@ public interface JwtParserBuilder extends Builder<JwtParser> {
|
||||||
* @param key the algorithm-specific decryption key to use to decrypt all encountered JWEs.
|
* @param key the algorithm-specific decryption key to use to decrypt all encountered JWEs.
|
||||||
* @return the parser builder for method chaining.
|
* @return the parser builder for method chaining.
|
||||||
* @see #decryptWith(SecretKey)
|
* @see #decryptWith(SecretKey)
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
JwtParserBuilder decryptWith(PrivateKey key);
|
JwtParserBuilder decryptWith(PrivateKey key);
|
||||||
|
|
||||||
|
@ -506,14 +506,14 @@ public interface JwtParserBuilder extends Builder<JwtParser> {
|
||||||
*
|
*
|
||||||
* @param keyLocator the locator used to retrieve decryption or signature verification keys.
|
* @param keyLocator the locator used to retrieve decryption or signature verification keys.
|
||||||
* @return the parser builder for method chaining.
|
* @return the parser builder for method chaining.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
JwtParserBuilder keyLocator(Locator<Key> keyLocator);
|
JwtParserBuilder keyLocator(Locator<Key> keyLocator);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p><b>Deprecation Notice</b></p>
|
* <p><b>Deprecation Notice</b></p>
|
||||||
*
|
*
|
||||||
* <p>This method has been deprecated as of JJWT version JJWT_RELEASE_VERSION because it only supports key location
|
* <p>This method has been deprecated as of JJWT version 0.12.0 because it only supports key location
|
||||||
* for JWSs (signed JWTs) instead of both signed (JWS) and encrypted (JWE) scenarios. Use the
|
* for JWSs (signed JWTs) instead of both signed (JWS) and encrypted (JWE) scenarios. Use the
|
||||||
* {@link #keyLocator(Locator) keyLocator} method instead to ensure a locator that can work for both JWS and
|
* {@link #keyLocator(Locator) keyLocator} method instead to ensure a locator that can work for both JWS and
|
||||||
* JWE inputs. This method will be removed for the 1.0 release.</p>
|
* JWE inputs. This method will be removed for the 1.0 release.</p>
|
||||||
|
@ -542,7 +542,7 @@ public interface JwtParserBuilder extends Builder<JwtParser> {
|
||||||
*
|
*
|
||||||
* @param signingKeyResolver the signing key resolver used to retrieve the signing key.
|
* @param signingKeyResolver the signing key resolver used to retrieve the signing key.
|
||||||
* @return the parser builder for method chaining.
|
* @return the parser builder for method chaining.
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #keyLocator(Locator)}
|
* @deprecated since 0.12.0 in favor of {@link #keyLocator(Locator)}
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("DeprecatedIsStillUsed")
|
@SuppressWarnings("DeprecatedIsStillUsed")
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -585,7 +585,7 @@ public interface JwtParserBuilder extends Builder<JwtParser> {
|
||||||
* @see Jwts.ENC
|
* @see Jwts.ENC
|
||||||
* @see <a href="https://www.rfc-editor.org/rfc/rfc7516.html#section-4.1.2">"enc" (Encryption Algorithm) Header Parameter</a>
|
* @see <a href="https://www.rfc-editor.org/rfc/rfc7516.html#section-4.1.2">"enc" (Encryption Algorithm) Header Parameter</a>
|
||||||
* @see <a href="https://www.rfc-editor.org/rfc/rfc7518.html#section-7.1.1">Encryption Algorithm Name (id) requirements</a>
|
* @see <a href="https://www.rfc-editor.org/rfc/rfc7518.html#section-7.1.1">Encryption Algorithm Name (id) requirements</a>
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
NestedCollection<AeadAlgorithm, JwtParserBuilder> enc();
|
NestedCollection<AeadAlgorithm, JwtParserBuilder> enc();
|
||||||
|
|
||||||
|
@ -625,7 +625,7 @@ public interface JwtParserBuilder extends Builder<JwtParser> {
|
||||||
* @see Jwts.KEY
|
* @see Jwts.KEY
|
||||||
* @see <a href="https://www.rfc-editor.org/rfc/rfc7516.html#section-4.1.1">JWE "alg" (Algorithm) Header Parameter</a>
|
* @see <a href="https://www.rfc-editor.org/rfc/rfc7516.html#section-4.1.1">JWE "alg" (Algorithm) Header Parameter</a>
|
||||||
* @see <a href="https://www.rfc-editor.org/rfc/rfc7518.html#section-7.1.1">Key Algorithm Name (id) requirements</a>
|
* @see <a href="https://www.rfc-editor.org/rfc/rfc7518.html#section-7.1.1">Key Algorithm Name (id) requirements</a>
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
NestedCollection<KeyAlgorithm<?, ?>, JwtParserBuilder> key();
|
NestedCollection<KeyAlgorithm<?, ?>, JwtParserBuilder> key();
|
||||||
|
|
||||||
|
@ -667,7 +667,7 @@ public interface JwtParserBuilder extends Builder<JwtParser> {
|
||||||
* @see Jwts.SIG
|
* @see Jwts.SIG
|
||||||
* @see <a href="https://www.rfc-editor.org/rfc/rfc7515.html#section-4.1.1">JWS "alg" (Algorithm) Header Parameter</a>
|
* @see <a href="https://www.rfc-editor.org/rfc/rfc7515.html#section-4.1.1">JWS "alg" (Algorithm) Header Parameter</a>
|
||||||
* @see <a href="https://www.rfc-editor.org/rfc/rfc7518.html#section-7.1.1">Algorithm Name (id) requirements</a>
|
* @see <a href="https://www.rfc-editor.org/rfc/rfc7518.html#section-7.1.1">Algorithm Name (id) requirements</a>
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
NestedCollection<SecureDigestAlgorithm<?, ?>, JwtParserBuilder> sig();
|
NestedCollection<SecureDigestAlgorithm<?, ?>, JwtParserBuilder> sig();
|
||||||
|
|
||||||
|
@ -707,14 +707,14 @@ public interface JwtParserBuilder extends Builder<JwtParser> {
|
||||||
* @see Jwts.ZIP
|
* @see Jwts.ZIP
|
||||||
* @see <a href="https://www.rfc-editor.org/rfc/rfc7516#section-4.1.3">"zip" (Compression Algorithm) Header Parameter</a>
|
* @see <a href="https://www.rfc-editor.org/rfc/rfc7516#section-4.1.3">"zip" (Compression Algorithm) Header Parameter</a>
|
||||||
* @see <a href="https://www.rfc-editor.org/rfc/rfc7518.html#section-7.3.1">Compression Algorithm Name (id) requirements</a>
|
* @see <a href="https://www.rfc-editor.org/rfc/rfc7518.html#section-7.3.1">Compression Algorithm Name (id) requirements</a>
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
NestedCollection<CompressionAlgorithm, JwtParserBuilder> zip();
|
NestedCollection<CompressionAlgorithm, JwtParserBuilder> zip();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p><b>Deprecated as of JJWT JJWT_RELEASE_VERSION. This method will be removed before the 1.0 release.</b></p>
|
* <p><b>Deprecated as of JJWT 0.12.0. This method will be removed before the 1.0 release.</b></p>
|
||||||
*
|
*
|
||||||
* <p>This method has been deprecated as of JJWT version JJWT_RELEASE_VERSION because it imposed unnecessary
|
* <p>This method has been deprecated as of JJWT version 0.12.0 because it imposed unnecessary
|
||||||
* implementation requirements on application developers when simply adding to a compression algorithm collection
|
* implementation requirements on application developers when simply adding to a compression algorithm collection
|
||||||
* would suffice. Use the {@link #zip()} method instead to add
|
* would suffice. Use the {@link #zip()} method instead to add
|
||||||
* any custom algorithm implementations without needing to also implement a Locator implementation.</p>
|
* any custom algorithm implementations without needing to also implement a Locator implementation.</p>
|
||||||
|
@ -736,7 +736,7 @@ public interface JwtParserBuilder extends Builder<JwtParser> {
|
||||||
*
|
*
|
||||||
* @param compressionCodecResolver the compression codec resolver used to decompress the JWT body.
|
* @param compressionCodecResolver the compression codec resolver used to decompress the JWT body.
|
||||||
* @return the parser builder for method chaining.
|
* @return the parser builder for method chaining.
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #zip()}. This method will be removed before the
|
* @deprecated since 0.12.0 in favor of {@link #zip()}. This method will be removed before the
|
||||||
* 1.0 release.
|
* 1.0 release.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -750,7 +750,7 @@ public interface JwtParserBuilder extends Builder<JwtParser> {
|
||||||
*
|
*
|
||||||
* @param base64UrlDecoder the decoder to use when Base64Url-decoding
|
* @param base64UrlDecoder the decoder to use when Base64Url-decoding
|
||||||
* @return the parser builder for method chaining.
|
* @return the parser builder for method chaining.
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #b64Url(Decoder)}. This method will be removed
|
* @deprecated since 0.12.0 in favor of {@link #b64Url(Decoder)}. This method will be removed
|
||||||
* before the JJWT 1.0 release.
|
* before the JJWT 1.0 release.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -782,7 +782,7 @@ public interface JwtParserBuilder extends Builder<JwtParser> {
|
||||||
*
|
*
|
||||||
* @param deserializer the deserializer to use when converting JSON Strings (UTF-8 byte arrays) into Map objects.
|
* @param deserializer the deserializer to use when converting JSON Strings (UTF-8 byte arrays) into Map objects.
|
||||||
* @return the builder for method chaining.
|
* @return the builder for method chaining.
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #json(Deserializer)}.
|
* @deprecated since 0.12.0 in favor of {@link #json(Deserializer)}.
|
||||||
* This method will be removed before the JJWT 1.0 release.
|
* This method will be removed before the JJWT 1.0 release.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@ -800,7 +800,7 @@ public interface JwtParserBuilder extends Builder<JwtParser> {
|
||||||
*
|
*
|
||||||
* @param deserializer the deserializer to use to deserialize JSON (UTF-8 byte streams) into Map instances.
|
* @param deserializer the deserializer to use to deserialize JSON (UTF-8 byte streams) into Map instances.
|
||||||
* @return the builder for method chaining.
|
* @return the builder for method chaining.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
JwtParserBuilder json(Deserializer<Map<String, ?>> deserializer);
|
JwtParserBuilder json(Deserializer<Map<String, ?>> deserializer);
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ package io.jsonwebtoken;
|
||||||
* avoiding type-checking if-then-else conditionals in favor of type-safe method dispatch when encountering a JWT.
|
* avoiding type-checking if-then-else conditionals in favor of type-safe method dispatch when encountering a JWT.
|
||||||
*
|
*
|
||||||
* @param <T> the type of object to return after invoking the {@link Jwt#accept(JwtVisitor)} method.
|
* @param <T> the type of object to return after invoking the {@link Jwt#accept(JwtVisitor)} method.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface JwtVisitor<T> {
|
public interface JwtVisitor<T> {
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@ public final class Jwts {
|
||||||
* <p>They are also available together as a {@link Registry} instance via the {@link #get()} method.</p>
|
* <p>They are also available together as a {@link Registry} instance via the {@link #get()} method.</p>
|
||||||
*
|
*
|
||||||
* @see #get()
|
* @see #get()
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public static final class ENC {
|
public static final class ENC {
|
||||||
|
|
||||||
|
@ -166,7 +166,7 @@ public final class Jwts {
|
||||||
* <p>They are also available together as a {@link Registry} instance via the {@link #get()} method.</p>
|
* <p>They are also available together as a {@link Registry} instance via the {@link #get()} method.</p>
|
||||||
*
|
*
|
||||||
* @see #get()
|
* @see #get()
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public static final class SIG {
|
public static final class SIG {
|
||||||
|
|
||||||
|
@ -327,7 +327,7 @@ public final class Jwts {
|
||||||
* <p>They are also available together as a {@link Registry} instance via the {@link #get()} method.</p>
|
* <p>They are also available together as a {@link Registry} instance via the {@link #get()} method.</p>
|
||||||
*
|
*
|
||||||
* @see #get()
|
* @see #get()
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public static final class KEY {
|
public static final class KEY {
|
||||||
|
|
||||||
|
@ -955,7 +955,7 @@ public final class Jwts {
|
||||||
* <p>They are also available together as a {@link Registry} instance via the {@link #get()} method.</p>
|
* <p>They are also available together as a {@link Registry} instance via the {@link #get()} method.</p>
|
||||||
*
|
*
|
||||||
* @see #get()
|
* @see #get()
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public static final class ZIP {
|
public static final class ZIP {
|
||||||
|
|
||||||
|
@ -1004,7 +1004,7 @@ public final class Jwts {
|
||||||
/**
|
/**
|
||||||
* A {@link Builder} that dynamically determines the type of {@link Header} to create based on builder state.
|
* A {@link Builder} that dynamically determines the type of {@link Header} to create based on builder state.
|
||||||
*
|
*
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface HeaderBuilder extends JweHeaderMutator<HeaderBuilder>, X509Builder<HeaderBuilder>, Builder<Header> {
|
public interface HeaderBuilder extends JweHeaderMutator<HeaderBuilder>, X509Builder<HeaderBuilder>, Builder<Header> {
|
||||||
}
|
}
|
||||||
|
@ -1015,7 +1015,7 @@ public final class Jwts {
|
||||||
*
|
*
|
||||||
* @return a new {@link HeaderBuilder} that can build any type of {@link Header} instance depending on
|
* @return a new {@link HeaderBuilder} that can build any type of {@link Header} instance depending on
|
||||||
* which builder properties are set.
|
* which builder properties are set.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public static HeaderBuilder header() {
|
public static HeaderBuilder header() {
|
||||||
return Classes.newInstance("io.jsonwebtoken.impl.DefaultJwtHeaderBuilder");
|
return Classes.newInstance("io.jsonwebtoken.impl.DefaultJwtHeaderBuilder");
|
||||||
|
@ -1033,7 +1033,7 @@ public final class Jwts {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p><b>Deprecated since JJWT_RELEASE_VERSION in favor of
|
* <p><b>Deprecated since 0.12.0 in favor of
|
||||||
* {@code Jwts.}{@link #claims()}{@code .add(map).build()}</b>.
|
* {@code Jwts.}{@link #claims()}{@code .add(map).build()}</b>.
|
||||||
* This method will be removed before 1.0.</p>
|
* This method will be removed before 1.0.</p>
|
||||||
*
|
*
|
||||||
|
@ -1041,7 +1041,7 @@ public final class Jwts {
|
||||||
*
|
*
|
||||||
* @param claims the name/value pairs to populate the new Claims instance.
|
* @param claims the name/value pairs to populate the new Claims instance.
|
||||||
* @return a new {@link Claims} instance populated with the specified name/value pairs.
|
* @return a new {@link Claims} instance populated with the specified name/value pairs.
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@code Jwts.}{@link #claims()}{@code .putAll(map).build()}.
|
* @deprecated since 0.12.0 in favor of {@code Jwts.}{@link #claims()}{@code .putAll(map).build()}.
|
||||||
* This method will be removed before 1.0.
|
* This method will be removed before 1.0.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
|
|
@ -26,7 +26,7 @@ import java.security.Key;
|
||||||
* {@code key} to decrypt a JWE or verify a JWS signature.</p>
|
* {@code key} to decrypt a JWE or verify a JWS signature.</p>
|
||||||
*
|
*
|
||||||
* @param <T> the type of object that may be returned from the {@link #locate(Header)} method
|
* @param <T> the type of object that may be returned from the {@link #locate(Header)} method
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface Locator<T> {
|
public interface Locator<T> {
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ import io.jsonwebtoken.lang.Assert;
|
||||||
* unprotected JWT, or an integrity-protected JWT (either a JWS or JWE).
|
* unprotected JWT, or an integrity-protected JWT (either a JWS or JWE).
|
||||||
*
|
*
|
||||||
* @param <T> the type of object to locate
|
* @param <T> the type of object to locate
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public abstract class LocatorAdapter<T> implements Locator<T> {
|
public abstract class LocatorAdapter<T> implements Locator<T> {
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ public class MissingClaimException extends InvalidClaimException {
|
||||||
* @param claimValue the value of the claim that could not be validated
|
* @param claimValue the value of the claim that could not be validated
|
||||||
* @param message the message explaining why the exception is thrown.
|
* @param message the message explaining why the exception is thrown.
|
||||||
* @param cause the underlying cause that resulted in this exception being thrown.
|
* @param cause the underlying cause that resulted in this exception being thrown.
|
||||||
* @deprecated since JJWT_RELEASE_VERSION since it is not used in JJWT's codebase
|
* @deprecated since 0.12.0 since it is not used in JJWT's codebase
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public MissingClaimException(Header header, Claims claims, String claimName, Object claimValue, String message, Throwable cause) {
|
public MissingClaimException(Header header, Claims claims, String claimName, Object claimValue, String message, Throwable cause) {
|
||||||
|
|
|
@ -41,7 +41,7 @@ public class PrematureJwtException extends ClaimJwtException {
|
||||||
* @param message exception message
|
* @param message exception message
|
||||||
* @param cause cause
|
* @param cause cause
|
||||||
* @since 0.5
|
* @since 0.5
|
||||||
* @deprecated since JJWT_RELEASE_VERSION since it is not used in JJWT's codebase
|
* @deprecated since 0.12.0 since it is not used in JJWT's codebase
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public PrematureJwtException(Header header, Claims claims, String message, Throwable cause) {
|
public PrematureJwtException(Header header, Claims claims, String message, Throwable cause) {
|
||||||
|
|
|
@ -26,7 +26,7 @@ import java.util.Set;
|
||||||
*
|
*
|
||||||
* @see JwsHeader
|
* @see JwsHeader
|
||||||
* @see JweHeader
|
* @see JweHeader
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface ProtectedHeader extends Header, X509Accessor {
|
public interface ProtectedHeader extends Header, X509Accessor {
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ import java.net.URI;
|
||||||
* Mutation (modifications) to a {@link ProtectedHeader Header} instance.
|
* Mutation (modifications) to a {@link ProtectedHeader Header} instance.
|
||||||
*
|
*
|
||||||
* @param <T> the mutator subtype, for method chaining
|
* @param <T> the mutator subtype, for method chaining
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface ProtectedHeaderMutator<T extends ProtectedHeaderMutator<T>> extends HeaderMutator<T>, X509Mutator<T> {
|
public interface ProtectedHeaderMutator<T extends ProtectedHeaderMutator<T>> extends HeaderMutator<T>, X509Mutator<T> {
|
||||||
|
|
||||||
|
@ -90,25 +90,25 @@ public interface ProtectedHeaderMutator<T extends ProtectedHeaderMutator<T>> ext
|
||||||
T keyId(String kid);
|
T keyId(String kid);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deprecated since JJWT_RELEASE_VERSION, delegates to {@link #keyId(String)}.
|
* Deprecated since 0.12.0, delegates to {@link #keyId(String)}.
|
||||||
*
|
*
|
||||||
* @param kid the case-sensitive JWS {@code kid} header value or {@code null} to remove the property from the JSON map.
|
* @param kid the case-sensitive JWS {@code kid} header value or {@code null} to remove the property from the JSON map.
|
||||||
* @return the instance for method chaining.
|
* @return the instance for method chaining.
|
||||||
* @see <a href="https://www.rfc-editor.org/rfc/rfc7515.html#section-4.1.4">JWS Key ID</a>
|
* @see <a href="https://www.rfc-editor.org/rfc/rfc7515.html#section-4.1.4">JWS Key ID</a>
|
||||||
* @see <a href="https://www.rfc-editor.org/rfc/rfc7516.html#section-4.1.6">JWE Key ID</a>
|
* @see <a href="https://www.rfc-editor.org/rfc/rfc7516.html#section-4.1.6">JWE Key ID</a>
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of the more modern builder-style {@link #keyId(String)} method.
|
* @deprecated since 0.12.0 in favor of the more modern builder-style {@link #keyId(String)} method.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
T setKeyId(String kid);
|
T setKeyId(String kid);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deprecated as of JJWT_RELEASE_VERSION, there is no need to set this any longer as the {@code JwtBuilder} will
|
* Deprecated as of 0.12.0, there is no need to set this any longer as the {@code JwtBuilder} will
|
||||||
* always set the {@code alg} header as necessary.
|
* always set the {@code alg} header as necessary.
|
||||||
*
|
*
|
||||||
* @param alg the JWS or JWE algorithm {@code alg} value or {@code null} to remove the property from the JSON map.
|
* @param alg the JWS or JWE algorithm {@code alg} value or {@code null} to remove the property from the JSON map.
|
||||||
* @return the instance for method chaining.
|
* @return the instance for method chaining.
|
||||||
* @since 0.1
|
* @since 0.1
|
||||||
* @deprecated since JJWT_RELEASE_VERSION and will be removed before the 1.0 release.
|
* @deprecated since 0.12.0 and will be removed before the 1.0 release.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
T setAlgorithm(String alg);
|
T setAlgorithm(String alg);
|
||||||
|
|
|
@ -31,7 +31,7 @@ import io.jsonwebtoken.security.DigestSupplier;
|
||||||
*
|
*
|
||||||
* @param <H> the type of the JWT protected header
|
* @param <H> the type of the JWT protected header
|
||||||
* @param <P> the type of the JWT payload, either a content byte array or a {@link Claims} instance.
|
* @param <P> the type of the JWT payload, either a content byte array or a {@link Claims} instance.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface ProtectedJwt<H extends ProtectedHeader, P> extends Jwt<H, P>, DigestSupplier {
|
public interface ProtectedJwt<H extends ProtectedHeader, P> extends Jwt<H, P>, DigestSupplier {
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ import java.util.List;
|
||||||
* <a href="https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-31">JSON Web Algorithms</a> specification.
|
* <a href="https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-31">JSON Web Algorithms</a> specification.
|
||||||
*
|
*
|
||||||
* @since 0.1
|
* @since 0.1
|
||||||
* @deprecated since JJWT_RELEASE_VERSION; use {@link Jwts.SIG} instead.
|
* @deprecated since 0.12.0; use {@link Jwts.SIG} instead.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public enum SignatureAlgorithm {
|
public enum SignatureAlgorithm {
|
||||||
|
|
|
@ -46,7 +46,7 @@ import java.security.Key;
|
||||||
*
|
*
|
||||||
* @see io.jsonwebtoken.JwtParserBuilder#keyLocator(Locator)
|
* @see io.jsonwebtoken.JwtParserBuilder#keyLocator(Locator)
|
||||||
* @since 0.4
|
* @since 0.4
|
||||||
* @deprecated since JJWT_RELEASE_VERSION. Implement {@link Locator} instead.
|
* @deprecated since 0.12.0. Implement {@link Locator} instead.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public interface SigningKeyResolver {
|
public interface SigningKeyResolver {
|
||||||
|
|
|
@ -23,7 +23,7 @@ import java.security.Key;
|
||||||
/**
|
/**
|
||||||
* <h2>Deprecation Notice</h2>
|
* <h2>Deprecation Notice</h2>
|
||||||
*
|
*
|
||||||
* <p>As of JJWT JJWT_RELEASE_VERSION, various Resolver concepts (including the {@code SigningKeyResolver}) have been
|
* <p>As of JJWT 0.12.0, various Resolver concepts (including the {@code SigningKeyResolver}) have been
|
||||||
* unified into a single {@link Locator} interface. For key location, (for both signing and encryption keys),
|
* unified into a single {@link Locator} interface. For key location, (for both signing and encryption keys),
|
||||||
* use the {@link JwtParserBuilder#keyLocator(Locator)} to configure a parser with your desired Key locator instead
|
* use the {@link JwtParserBuilder#keyLocator(Locator)} to configure a parser with your desired Key locator instead
|
||||||
* of using a {@code SigningKeyResolver}. Also see {@link LocatorAdapter} for the Adapter pattern parallel of this
|
* of using a {@code SigningKeyResolver}. Also see {@link LocatorAdapter} for the Adapter pattern parallel of this
|
||||||
|
@ -49,7 +49,7 @@ import java.security.Key;
|
||||||
* @see io.jsonwebtoken.JwtParserBuilder#keyLocator(Locator)
|
* @see io.jsonwebtoken.JwtParserBuilder#keyLocator(Locator)
|
||||||
* @see LocatorAdapter
|
* @see LocatorAdapter
|
||||||
* @since 0.4
|
* @since 0.4
|
||||||
* @deprecated since JJWT_RELEASE_VERSION. Use {@link LocatorAdapter LocatorAdapter} with
|
* @deprecated since 0.12.0. Use {@link LocatorAdapter LocatorAdapter} with
|
||||||
* {@link JwtParserBuilder#keyLocator(Locator)}
|
* {@link JwtParserBuilder#keyLocator(Locator)}
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("DeprecatedIsStillUsed")
|
@SuppressWarnings("DeprecatedIsStillUsed")
|
||||||
|
|
|
@ -23,7 +23,7 @@ import io.jsonwebtoken.lang.Assert;
|
||||||
* only if the type-specific handler method is overridden by a subclass.
|
* only if the type-specific handler method is overridden by a subclass.
|
||||||
*
|
*
|
||||||
* @param <T> the type of value returned from the subclass handler method implementation.
|
* @param <T> the type of value returned from the subclass handler method implementation.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public class SupportedJwtVisitor<T> implements JwtVisitor<T> {
|
public class SupportedJwtVisitor<T> implements JwtVisitor<T> {
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ import java.nio.charset.StandardCharsets;
|
||||||
* {@link #doDeserialize(Reader)}.
|
* {@link #doDeserialize(Reader)}.
|
||||||
*
|
*
|
||||||
* @param <T> the type of object returned after deserialization
|
* @param <T> the type of object returned after deserialization
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractDeserializer<T> implements Deserializer<T> {
|
public abstract class AbstractDeserializer<T> implements Deserializer<T> {
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ import java.io.OutputStream;
|
||||||
* * {@link #doSerialize(Object, OutputStream)}.
|
* * {@link #doSerialize(Object, OutputStream)}.
|
||||||
*
|
*
|
||||||
* @param <T> the type of object to serialize
|
* @param <T> the type of object to serialize
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractSerializer<T> implements Serializer<T> {
|
public abstract class AbstractSerializer<T> implements Serializer<T> {
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ public abstract class AbstractSerializer<T> implements Serializer<T> {
|
||||||
* @param out the stream to write to
|
* @param out the stream to write to
|
||||||
* @throws Exception if there is a problem converting the object to a byte stream or writing the
|
* @throws Exception if there is a problem converting the object to a byte stream or writing the
|
||||||
* bytes to the {@code out}put stream.
|
* bytes to the {@code out}put stream.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
protected abstract void doSerialize(T t, OutputStream out) throws Exception;
|
protected abstract void doSerialize(T t, OutputStream out) throws Exception;
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@ import java.io.OutputStream;
|
||||||
* @see Jwts.ZIP#DEF
|
* @see Jwts.ZIP#DEF
|
||||||
* @see Jwts.ZIP#GZIP
|
* @see Jwts.ZIP#GZIP
|
||||||
* @see <a href="https://www.rfc-editor.org/rfc/rfc7518.html#section-7.3">JSON Web Encryption Compression Algorithms Registry</a>
|
* @see <a href="https://www.rfc-editor.org/rfc/rfc7518.html#section-7.3">JSON Web Encryption Compression Algorithms Registry</a>
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface CompressionAlgorithm extends Identifiable {
|
public interface CompressionAlgorithm extends Identifiable {
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ public interface Deserializer<T> {
|
||||||
* @param bytes the formatted data byte array to convert
|
* @param bytes the formatted data byte array to convert
|
||||||
* @return the reconstituted Java object
|
* @return the reconstituted Java object
|
||||||
* @throws DeserializationException if there is a problem converting the byte array to an object.
|
* @throws DeserializationException if there is a problem converting the byte array to an object.
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #deserialize(Reader)}
|
* @deprecated since 0.12.0 in favor of {@link #deserialize(Reader)}
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
T deserialize(byte[] bytes) throws DeserializationException;
|
T deserialize(byte[] bytes) throws DeserializationException;
|
||||||
|
@ -42,7 +42,7 @@ public interface Deserializer<T> {
|
||||||
* @param reader the reader to use to read the character stream
|
* @param reader the reader to use to read the character stream
|
||||||
* @return the deserialized Java object
|
* @return the deserialized Java object
|
||||||
* @throws DeserializationException if there is a problem reading the stream or creating the expected Java object
|
* @throws DeserializationException if there is a problem reading the stream or creating the expected Java object
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
T deserialize(Reader reader) throws DeserializationException;
|
T deserialize(Reader reader) throws DeserializationException;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ import java.io.Reader;
|
||||||
* A Parser converts a character stream into a Java object.
|
* A Parser converts a character stream into a Java object.
|
||||||
*
|
*
|
||||||
* @param <T> the instance type created after parsing
|
* @param <T> the instance type created after parsing
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface Parser<T> {
|
public interface Parser<T> {
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ import java.util.Map;
|
||||||
*
|
*
|
||||||
* @param <T> The resulting parser's {@link Parser#parse parse} output type
|
* @param <T> The resulting parser's {@link Parser#parse parse} output type
|
||||||
* @param <B> builder type used for method chaining
|
* @param <B> builder type used for method chaining
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface ParserBuilder<T, B extends ParserBuilder<T, B>> extends Builder<Parser<T>> {
|
public interface ParserBuilder<T, B extends ParserBuilder<T, B>> extends Builder<Parser<T>> {
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ public interface Serializer<T> {
|
||||||
* @param t the object to serialize
|
* @param t the object to serialize
|
||||||
* @return the serialized byte array representing the specified object.
|
* @return the serialized byte array representing the specified object.
|
||||||
* @throws SerializationException if there is a problem converting the object to a byte array.
|
* @throws SerializationException if there is a problem converting the object to a byte array.
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #serialize(Object, OutputStream)}
|
* @deprecated since 0.12.0 in favor of {@link #serialize(Object, OutputStream)}
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
byte[] serialize(T t) throws SerializationException;
|
byte[] serialize(T t) throws SerializationException;
|
||||||
|
@ -45,7 +45,7 @@ public interface Serializer<T> {
|
||||||
* @param out the stream to write to
|
* @param out the stream to write to
|
||||||
* @throws SerializationException if there is a problem converting the object to a byte stream or writing the
|
* @throws SerializationException if there is a problem converting the object to a byte stream or writing the
|
||||||
* bytes to the {@code out}put stream.
|
* bytes to the {@code out}put stream.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
void serialize(T t, OutputStream out) throws SerializationException;
|
void serialize(T t, OutputStream out) throws SerializationException;
|
||||||
}
|
}
|
||||||
|
|
|
@ -230,7 +230,7 @@ public final class Assert {
|
||||||
* @param msg the exception message to use if the assertion fails
|
* @param msg the exception message to use if the assertion fails
|
||||||
* @return the byte array if the assertion passes
|
* @return the byte array if the assertion passes
|
||||||
* @throws IllegalArgumentException if the byte array is null or empty
|
* @throws IllegalArgumentException if the byte array is null or empty
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public static byte[] notEmpty(byte[] array, String msg) {
|
public static byte[] notEmpty(byte[] array, String msg) {
|
||||||
if (Objects.isEmpty(array)) {
|
if (Objects.isEmpty(array)) {
|
||||||
|
@ -246,7 +246,7 @@ public final class Assert {
|
||||||
* @param msg the exception message to use if the assertion fails
|
* @param msg the exception message to use if the assertion fails
|
||||||
* @return the character array if the assertion passes
|
* @return the character array if the assertion passes
|
||||||
* @throws IllegalArgumentException if the character array is null or empty
|
* @throws IllegalArgumentException if the character array is null or empty
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public static char[] notEmpty(char[] chars, String msg) {
|
public static char[] notEmpty(char[] chars, String msg) {
|
||||||
if (Objects.isEmpty(chars)) {
|
if (Objects.isEmpty(chars)) {
|
||||||
|
@ -454,7 +454,7 @@ public final class Assert {
|
||||||
* @param requirement the requirement that {@code value} must be greater than
|
* @param requirement the requirement that {@code value} must be greater than
|
||||||
* @param msg the message to use for the {@code IllegalArgumentException} if thrown.
|
* @param msg the message to use for the {@code IllegalArgumentException} if thrown.
|
||||||
* @return {@code value} if greater than the specified {@code requirement}.
|
* @return {@code value} if greater than the specified {@code requirement}.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public static <T extends Comparable<T>> T eq(T value, T requirement, String msg) {
|
public static <T extends Comparable<T>> T eq(T value, T requirement, String msg) {
|
||||||
if (compareTo(value, requirement) != 0) {
|
if (compareTo(value, requirement) != 0) {
|
||||||
|
@ -478,7 +478,7 @@ public final class Assert {
|
||||||
* @param requirement the requirement that {@code value} must be greater than
|
* @param requirement the requirement that {@code value} must be greater than
|
||||||
* @param msg the message to use for the {@code IllegalArgumentException} if thrown.
|
* @param msg the message to use for the {@code IllegalArgumentException} if thrown.
|
||||||
* @return {@code value} if greater than the specified {@code requirement}.
|
* @return {@code value} if greater than the specified {@code requirement}.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public static <T extends Comparable<T>> T gt(T value, T requirement, String msg) {
|
public static <T extends Comparable<T>> T gt(T value, T requirement, String msg) {
|
||||||
if (!(compareTo(value, requirement) > 0)) {
|
if (!(compareTo(value, requirement) > 0)) {
|
||||||
|
@ -496,7 +496,7 @@ public final class Assert {
|
||||||
* @param requirement the requirement that {@code value} must be greater than
|
* @param requirement the requirement that {@code value} must be greater than
|
||||||
* @param msg the message to use for the {@code IllegalArgumentException} if thrown.
|
* @param msg the message to use for the {@code IllegalArgumentException} if thrown.
|
||||||
* @return {@code value} if greater than the specified {@code requirement}.
|
* @return {@code value} if greater than the specified {@code requirement}.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public static <T extends Comparable<T>> T lte(T value, T requirement, String msg) {
|
public static <T extends Comparable<T>> T lte(T value, T requirement, String msg) {
|
||||||
if (compareTo(value, requirement) > 0) {
|
if (compareTo(value, requirement) > 0) {
|
||||||
|
@ -546,7 +546,7 @@ public final class Assert {
|
||||||
* @param <T> value type
|
* @param <T> value type
|
||||||
* @return the non-null value
|
* @return the non-null value
|
||||||
* @throws IllegalStateException with the specified {@code msg} if {@code value} is null.
|
* @throws IllegalStateException with the specified {@code msg} if {@code value} is null.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public static <T> T stateNotNull(T value, String msg) throws IllegalStateException {
|
public static <T> T stateNotNull(T value, String msg) throws IllegalStateException {
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
|
|
|
@ -19,7 +19,7 @@ package io.jsonwebtoken.lang;
|
||||||
* Type-safe interface that reflects the <a href="https://en.wikipedia.org/wiki/Builder_pattern">Builder pattern</a>.
|
* Type-safe interface that reflects the <a href="https://en.wikipedia.org/wiki/Builder_pattern">Builder pattern</a>.
|
||||||
*
|
*
|
||||||
* @param <T> The type of object that will be created when {@link #build()} is invoked.
|
* @param <T> The type of object that will be created when {@link #build()} is invoked.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface Builder<T> {
|
public interface Builder<T> {
|
||||||
|
|
||||||
|
|
|
@ -130,7 +130,7 @@ public final class Classes {
|
||||||
* @param name the name of the resource to acquire from the classloader(s).
|
* @param name the name of the resource to acquire from the classloader(s).
|
||||||
* @return the URL of the resource found, or <code>null</code> if the resource cannot be found from any
|
* @return the URL of the resource found, or <code>null</code> if the resource cannot be found from any
|
||||||
* of the three mentioned ClassLoaders.
|
* of the three mentioned ClassLoaders.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
private static URL getResource(String name) {
|
private static URL getResource(String name) {
|
||||||
URL url = THREAD_CL_ACCESSOR.getResource(name);
|
URL url = THREAD_CL_ACCESSOR.getResource(name);
|
||||||
|
@ -311,7 +311,7 @@ public final class Classes {
|
||||||
* @param args the actual runtime arguments to use when invoking the method
|
* @param args the actual runtime arguments to use when invoking the method
|
||||||
* @param <T> the type of object expected to be returned from the method
|
* @param <T> the type of object expected to be returned from the method
|
||||||
* @return the result returned by the invoked method.
|
* @return the result returned by the invoked method.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public static <T> T invokeStatic(Class<?> clazz, String methodName, Class<?>[] argTypes, Object... args) {
|
public static <T> T invokeStatic(Class<?> clazz, String methodName, Class<?>[] argTypes, Object... args) {
|
||||||
|
|
|
@ -24,7 +24,7 @@ import java.util.Collection;
|
||||||
*
|
*
|
||||||
* @param <E> the type of elements in the collection
|
* @param <E> the type of elements in the collection
|
||||||
* @param <M> the mutator subtype, for method chaining
|
* @param <M> the mutator subtype, for method chaining
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface CollectionMutator<E, M extends CollectionMutator<E, M>> {
|
public interface CollectionMutator<E, M extends CollectionMutator<E, M>> {
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,7 @@ public final class Collections {
|
||||||
* @param c the collection to represent as a set
|
* @param c the collection to represent as a set
|
||||||
* @param <T> collection element type
|
* @param <T> collection element type
|
||||||
* @return a type-safe immutable {@code Set} containing the specified collection elements.
|
* @return a type-safe immutable {@code Set} containing the specified collection elements.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public static <T> Set<T> asSet(Collection<T> c) {
|
public static <T> Set<T> asSet(Collection<T> c) {
|
||||||
if (c instanceof Set) {
|
if (c instanceof Set) {
|
||||||
|
@ -125,7 +125,7 @@ public final class Collections {
|
||||||
* @param <K> map key type
|
* @param <K> map key type
|
||||||
* @param <V> map value type
|
* @param <V> map value type
|
||||||
* @return an immutable wrapper for {@code m}.
|
* @return an immutable wrapper for {@code m}.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public static <K, V> Map<K, V> immutable(Map<K, V> m) {
|
public static <K, V> Map<K, V> immutable(Map<K, V> m) {
|
||||||
return m != null ? java.util.Collections.unmodifiableMap(m) : null;
|
return m != null ? java.util.Collections.unmodifiableMap(m) : null;
|
||||||
|
@ -163,7 +163,7 @@ public final class Collections {
|
||||||
* @param <C> type of collection
|
* @param <C> type of collection
|
||||||
* @param <T> type of elements in the collection
|
* @param <T> type of elements in the collection
|
||||||
* @return an immutable wrapper for {@code l}.
|
* @return an immutable wrapper for {@code l}.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public static <T, C extends Collection<T>> C immutable(C c) {
|
public static <T, C extends Collection<T>> C immutable(C c) {
|
||||||
|
@ -184,7 +184,7 @@ public final class Collections {
|
||||||
* @param s the set to check for null
|
* @param s the set to check for null
|
||||||
* @param <T> type of elements in the set
|
* @param <T> type of elements in the set
|
||||||
* @return a non-null set, either {@code s} if it is not null, or {@link #emptySet()} otherwise.
|
* @return a non-null set, either {@code s} if it is not null, or {@link #emptySet()} otherwise.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public static <T> Set<T> nullSafe(Set<T> s) {
|
public static <T> Set<T> nullSafe(Set<T> s) {
|
||||||
return s == null ? Collections.<T>emptySet() : s;
|
return s == null ? Collections.<T>emptySet() : s;
|
||||||
|
@ -196,7 +196,7 @@ public final class Collections {
|
||||||
* @param c the collection to check for null
|
* @param c the collection to check for null
|
||||||
* @param <T> type of elements in the collection
|
* @param <T> type of elements in the collection
|
||||||
* @return a non-null collection, either {@code c} if it is not null, or {@link #emptyList()} otherwise.
|
* @return a non-null collection, either {@code c} if it is not null, or {@link #emptyList()} otherwise.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public static <T> Collection<T> nullSafe(Collection<T> c) {
|
public static <T> Collection<T> nullSafe(Collection<T> c) {
|
||||||
return c == null ? Collections.<T>emptyList() : c;
|
return c == null ? Collections.<T>emptyList() : c;
|
||||||
|
|
|
@ -20,7 +20,7 @@ package io.jsonwebtoken.lang;
|
||||||
* to the source/original builder.
|
* to the source/original builder.
|
||||||
*
|
*
|
||||||
* @param <T> the type of joined object to return.
|
* @param <T> the type of joined object to return.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface Conjunctor<T> {
|
public interface Conjunctor<T> {
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ import java.util.Map;
|
||||||
* @param <K> map key type
|
* @param <K> map key type
|
||||||
* @param <V> map value type
|
* @param <V> map value type
|
||||||
* @param <T> the mutator subtype, for method chaining
|
* @param <T> the mutator subtype, for method chaining
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface MapMutator<K, V, T extends MapMutator<K, V, T>> {
|
public interface MapMutator<K, V, T extends MapMutator<K, V, T>> {
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ package io.jsonwebtoken.lang;
|
||||||
*
|
*
|
||||||
* @param <E> the type of elements in the collection
|
* @param <E> the type of elements in the collection
|
||||||
* @param <P> the parent to return
|
* @param <P> the parent to return
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface NestedCollection<E, P> extends CollectionMutator<E, NestedCollection<E, P>>, Conjunctor<P> {
|
public interface NestedCollection<E, P> extends CollectionMutator<E, NestedCollection<E, P>>, Conjunctor<P> {
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,7 +102,7 @@ public final class Objects {
|
||||||
*
|
*
|
||||||
* @param v object to check
|
* @param v object to check
|
||||||
* @return {@code true} if the specified argument is empty, {@code false} otherwise.
|
* @return {@code true} if the specified argument is empty, {@code false} otherwise.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public static boolean isEmpty(Object v) {
|
public static boolean isEmpty(Object v) {
|
||||||
return v == null ||
|
return v == null ||
|
||||||
|
@ -1015,7 +1015,7 @@ public final class Objects {
|
||||||
* {@link Flushable#flush()} on each one, ignoring any potential {@link IOException}s.
|
* {@link Flushable#flush()} on each one, ignoring any potential {@link IOException}s.
|
||||||
*
|
*
|
||||||
* @param flushables the flushables to flush.
|
* @param flushables the flushables to flush.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public static void nullSafeFlush(Flushable... flushables) {
|
public static void nullSafeFlush(Flushable... flushables) {
|
||||||
if (flushables == null) return;
|
if (flushables == null) return;
|
||||||
|
|
|
@ -33,7 +33,7 @@ import java.util.Map;
|
||||||
*
|
*
|
||||||
* @param <K> key type
|
* @param <K> key type
|
||||||
* @param <V> value type
|
* @param <V> value type
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface Registry<K, V> extends Map<K, V> {
|
public interface Registry<K, V> extends Map<K, V> {
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
/**
|
/**
|
||||||
* No longer used by JJWT. Will be removed before the 1.0 final release.
|
* No longer used by JJWT. Will be removed before the 1.0 final release.
|
||||||
*
|
*
|
||||||
* @deprecated since JJWT_RELEASE_VERSION. will be removed before the 1.0 final release.
|
* @deprecated since 0.12.0. will be removed before the 1.0 final release.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public final class RuntimeEnvironment {
|
public final class RuntimeEnvironment {
|
||||||
|
@ -37,7 +37,7 @@ public final class RuntimeEnvironment {
|
||||||
/**
|
/**
|
||||||
* {@code true} if BouncyCastle is in the runtime classpath, {@code false} otherwise.
|
* {@code true} if BouncyCastle is in the runtime classpath, {@code false} otherwise.
|
||||||
*
|
*
|
||||||
* @deprecated since JJWT_RELEASE_VERSION. will be removed before the 1.0 final release.
|
* @deprecated since 0.12.0. will be removed before the 1.0 final release.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public static final boolean BOUNCY_CASTLE_AVAILABLE = Classes.isAvailable(BC_PROVIDER_CLASS_NAME);
|
public static final boolean BOUNCY_CASTLE_AVAILABLE = Classes.isAvailable(BC_PROVIDER_CLASS_NAME);
|
||||||
|
@ -46,7 +46,7 @@ public final class RuntimeEnvironment {
|
||||||
* Register BouncyCastle as a JCA provider in the system's {@link Security#getProviders() Security Providers} list
|
* Register BouncyCastle as a JCA provider in the system's {@link Security#getProviders() Security Providers} list
|
||||||
* if BouncyCastle is in the runtime classpath.
|
* if BouncyCastle is in the runtime classpath.
|
||||||
*
|
*
|
||||||
* @deprecated since JJWT_RELEASE_VERSION. will be removed before the 1.0 final release.
|
* @deprecated since 0.12.0. will be removed before the 1.0 final release.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public static void enableBouncyCastleIfPossible() {
|
public static void enableBouncyCastleIfPossible() {
|
||||||
|
|
|
@ -240,7 +240,7 @@ public final class Strings {
|
||||||
*
|
*
|
||||||
* @param s the string to obtain UTF-8 bytes
|
* @param s the string to obtain UTF-8 bytes
|
||||||
* @return the specified string's UTF-8 bytes, or {@code null} if the string is {@code null}.
|
* @return the specified string's UTF-8 bytes, or {@code null} if the string is {@code null}.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public static byte[] utf8(CharSequence s) {
|
public static byte[] utf8(CharSequence s) {
|
||||||
if (s == null) return null;
|
if (s == null) return null;
|
||||||
|
@ -258,7 +258,7 @@ public final class Strings {
|
||||||
*
|
*
|
||||||
* @param utf8Bytes UTF-8 bytes to use with the {@code String} constructor.
|
* @param utf8Bytes UTF-8 bytes to use with the {@code String} constructor.
|
||||||
* @return {@code new String(utf8Bytes, StandardCharsets.UTF_8)}.
|
* @return {@code new String(utf8Bytes, StandardCharsets.UTF_8)}.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public static String utf8(byte[] utf8Bytes) {
|
public static String utf8(byte[] utf8Bytes) {
|
||||||
return new String(utf8Bytes, UTF_8);
|
return new String(utf8Bytes, UTF_8);
|
||||||
|
@ -269,7 +269,7 @@ public final class Strings {
|
||||||
*
|
*
|
||||||
* @param asciiBytes US_ASCII bytes to use with the {@code String} constructor.
|
* @param asciiBytes US_ASCII bytes to use with the {@code String} constructor.
|
||||||
* @return {@code new String(asciiBytes, StandardCharsets.US_ASCII)}.
|
* @return {@code new String(asciiBytes, StandardCharsets.US_ASCII)}.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public static String ascii(byte[] asciiBytes) {
|
public static String ascii(byte[] asciiBytes) {
|
||||||
return new String(asciiBytes, StandardCharsets.US_ASCII);
|
return new String(asciiBytes, StandardCharsets.US_ASCII);
|
||||||
|
@ -1355,7 +1355,7 @@ public final class Strings {
|
||||||
*
|
*
|
||||||
* @param sb the string builder to append a space to if non-empty
|
* @param sb the string builder to append a space to if non-empty
|
||||||
* @return the string builder argument for method chaining.
|
* @return the string builder argument for method chaining.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public static StringBuilder nespace(StringBuilder sb) {
|
public static StringBuilder nespace(StringBuilder sb) {
|
||||||
if (sb == null) {
|
if (sb == null) {
|
||||||
|
|
|
@ -24,7 +24,7 @@ package io.jsonwebtoken.lang;
|
||||||
* JDK 7 environments.</p>
|
* JDK 7 environments.</p>
|
||||||
*
|
*
|
||||||
* @param <T> the type of object returned by this supplier
|
* @param <T> the type of object returned by this supplier
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface Supplier<T> {
|
public interface Supplier<T> {
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ import java.io.OutputStream;
|
||||||
* @see KeyLengthSupplier
|
* @see KeyLengthSupplier
|
||||||
* @see KeyBuilderSupplier
|
* @see KeyBuilderSupplier
|
||||||
* @see KeyBuilder
|
* @see KeyBuilder
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface AeadAlgorithm extends Identifiable, KeyLengthSupplier, KeyBuilderSupplier<SecretKey, SecretKeyBuilder> {
|
public interface AeadAlgorithm extends Identifiable, KeyLengthSupplier, KeyBuilderSupplier<SecretKey, SecretKeyBuilder> {
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ import java.io.InputStream;
|
||||||
*
|
*
|
||||||
* @see SecureRequest
|
* @see SecureRequest
|
||||||
* @see AssociatedDataSupplier
|
* @see AssociatedDataSupplier
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface AeadRequest extends SecureRequest<InputStream, SecretKey>, AssociatedDataSupplier {
|
public interface AeadRequest extends SecureRequest<InputStream, SecretKey>, AssociatedDataSupplier {
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ import java.io.OutputStream;
|
||||||
* and resulting {@link #setTag(byte[]) AAD tag} and {@link #setIv(byte[]) initialization vector}.
|
* and resulting {@link #setTag(byte[]) AAD tag} and {@link #setIv(byte[]) initialization vector}.
|
||||||
* The AAD tag and initialization vector must be supplied with the ciphertext to decrypt.
|
* The AAD tag and initialization vector must be supplied with the ciphertext to decrypt.
|
||||||
*
|
*
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface AeadResult {
|
public interface AeadResult {
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ import java.io.InputStream;
|
||||||
* <a href="https://en.wikipedia.org/wiki/Authenticated_encryption">AEAD encryption or decryption</a>.
|
* <a href="https://en.wikipedia.org/wiki/Authenticated_encryption">AEAD encryption or decryption</a>.
|
||||||
*
|
*
|
||||||
* @see #getAssociatedData()
|
* @see #getAssociatedData()
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface AssociatedDataSupplier {
|
public interface AssociatedDataSupplier {
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ import java.security.Key;
|
||||||
* JWK representation of an asymmetric (public or private) cryptographic key.
|
* JWK representation of an asymmetric (public or private) cryptographic key.
|
||||||
*
|
*
|
||||||
* @param <K> the type of {@link java.security.PublicKey} or {@link java.security.PrivateKey} represented by this JWK.
|
* @param <K> the type of {@link java.security.PublicKey} or {@link java.security.PrivateKey} represented by this JWK.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface AsymmetricJwk<K extends Key> extends Jwk<K>, X509Accessor {
|
public interface AsymmetricJwk<K extends Key> extends Jwk<K>, X509Accessor {
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ import java.security.Key;
|
||||||
* @param <K> the type of Java key provided by the JWK.
|
* @param <K> the type of Java key provided by the JWK.
|
||||||
* @param <J> the type of asymmetric JWK created
|
* @param <J> the type of asymmetric JWK created
|
||||||
* @param <T> the type of the builder, for subtype method chaining
|
* @param <T> the type of the builder, for subtype method chaining
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface AsymmetricJwkBuilder<K extends Key, J extends AsymmetricJwk<K>, T extends AsymmetricJwkBuilder<K, J, T>>
|
public interface AsymmetricJwkBuilder<K extends Key, J extends AsymmetricJwk<K>, T extends AsymmetricJwkBuilder<K, J, T>>
|
||||||
extends JwkBuilder<K, J, T>, X509Builder<T> {
|
extends JwkBuilder<K, J, T>, X509Builder<T> {
|
||||||
|
|
|
@ -35,7 +35,7 @@ import io.jsonwebtoken.Identifiable;
|
||||||
* <p>Constants for all JWA standard Curves are available via the {@link Jwks.CRV} registry.</p>
|
* <p>Constants for all JWA standard Curves are available via the {@link Jwks.CRV} registry.</p>
|
||||||
*
|
*
|
||||||
* @see Jwks.CRV
|
* @see Jwks.CRV
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface Curve extends Identifiable, KeyPairBuilderSupplier {
|
public interface Curve extends Identifiable, KeyPairBuilderSupplier {
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ import javax.crypto.SecretKey;
|
||||||
* decryption {@link SecretKey}. Extends both {@link IvSupplier} and {@link DigestSupplier} to
|
* decryption {@link SecretKey}. Extends both {@link IvSupplier} and {@link DigestSupplier} to
|
||||||
* ensure the respective required IV and AAD tag returned from an {@link AeadResult} are available for decryption.
|
* ensure the respective required IV and AAD tag returned from an {@link AeadResult} are available for decryption.
|
||||||
*
|
*
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface DecryptAeadRequest extends AeadRequest, IvSupplier, DigestSupplier {
|
public interface DecryptAeadRequest extends AeadRequest, IvSupplier, DigestSupplier {
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ import java.security.Key;
|
||||||
* to be available in the JWE protected header, accessible via {@link #getHeader()}.</p>
|
* to be available in the JWE protected header, accessible via {@link #getHeader()}.</p>
|
||||||
*
|
*
|
||||||
* @param <K> the type of {@link Key} used during the request to obtain the resulting decryption key.
|
* @param <K> the type of {@link Key} used during the request to obtain the resulting decryption key.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface DecryptionKeyRequest<K extends Key> extends SecureRequest<byte[], K>, KeyRequest<byte[]> {
|
public interface DecryptionKeyRequest<K extends Key> extends SecureRequest<byte[], K>, KeyRequest<byte[]> {
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@ import java.security.PublicKey;
|
||||||
* @param <V> the type of {@link VerifyDigestRequest} used when verifying a digest.
|
* @param <V> the type of {@link VerifyDigestRequest} used when verifying a digest.
|
||||||
* @see Jwks.HASH
|
* @see Jwks.HASH
|
||||||
* @see io.jsonwebtoken.Jwts.SIG Jwts.SIG
|
* @see io.jsonwebtoken.Jwts.SIG Jwts.SIG
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface DigestAlgorithm<R extends Request<InputStream>, V extends VerifyDigestRequest> extends Identifiable {
|
public interface DigestAlgorithm<R extends Request<InputStream>, V extends VerifyDigestRequest> extends Identifiable {
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ package io.jsonwebtoken.security;
|
||||||
* A {@code DigestSupplier} provides access to the result of a cryptographic digest algorithm, such as a
|
* A {@code DigestSupplier} provides access to the result of a cryptographic digest algorithm, such as a
|
||||||
* Message Digest, MAC, Signature, or Authentication Tag.
|
* Message Digest, MAC, Signature, or Authentication Tag.
|
||||||
*
|
*
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface DigestSupplier {
|
public interface DigestSupplier {
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ import java.util.List;
|
||||||
*
|
*
|
||||||
* @param <K> the type of Java {@link Key} represented by the created {@link Jwk}.
|
* @param <K> the type of Java {@link Key} represented by the created {@link Jwk}.
|
||||||
* @param <J> the type of {@link Jwk} created by the builder
|
* @param <J> the type of {@link Jwk} created by the builder
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface DynamicJwkBuilder<K extends Key, J extends Jwk<K>> extends JwkBuilder<K, J, DynamicJwkBuilder<K, J>> {
|
public interface DynamicJwkBuilder<K extends Key, J extends Jwk<K>> extends JwkBuilder<K, J, DynamicJwkBuilder<K, J>> {
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ import java.security.interfaces.ECPublicKey;
|
||||||
* jwk.get("y");
|
* jwk.get("y");
|
||||||
* // ... etc ...</pre></blockquote>
|
* // ... etc ...</pre></blockquote>
|
||||||
*
|
*
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface EcPrivateJwk extends PrivateJwk<ECPrivateKey, ECPublicKey, EcPublicJwk> {
|
public interface EcPrivateJwk extends PrivateJwk<ECPrivateKey, ECPublicKey, EcPublicJwk> {
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ import java.security.interfaces.ECPublicKey;
|
||||||
/**
|
/**
|
||||||
* A {@link PrivateJwkBuilder} that creates {@link EcPrivateJwk}s.
|
* A {@link PrivateJwkBuilder} that creates {@link EcPrivateJwk}s.
|
||||||
*
|
*
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface EcPrivateJwkBuilder extends PrivateJwkBuilder<ECPrivateKey, ECPublicKey, EcPublicJwk, EcPrivateJwk, EcPrivateJwkBuilder> {
|
public interface EcPrivateJwkBuilder extends PrivateJwkBuilder<ECPrivateKey, ECPublicKey, EcPublicJwk, EcPrivateJwk, EcPrivateJwkBuilder> {
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ import java.security.interfaces.ECPublicKey;
|
||||||
* jwk.get("y");
|
* jwk.get("y");
|
||||||
* // ... etc ...</pre></blockquote>
|
* // ... etc ...</pre></blockquote>
|
||||||
*
|
*
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface EcPublicJwk extends PublicJwk<ECPublicKey> {
|
public interface EcPublicJwk extends PublicJwk<ECPublicKey> {
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ import java.security.interfaces.ECPublicKey;
|
||||||
/**
|
/**
|
||||||
* A {@link PublicJwkBuilder} that creates {@link EcPublicJwk}s.
|
* A {@link PublicJwkBuilder} that creates {@link EcPublicJwk}s.
|
||||||
*
|
*
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface EcPublicJwkBuilder extends PublicJwkBuilder<ECPublicKey, ECPrivateKey, EcPublicJwk, EcPrivateJwk, EcPrivateJwkBuilder, EcPublicJwkBuilder> {
|
public interface EcPublicJwkBuilder extends PublicJwkBuilder<ECPublicKey, ECPrivateKey, EcPublicJwk, EcPrivateJwk, EcPrivateJwkBuilder, EcPublicJwkBuilder> {
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ import java.io.InputStream;
|
||||||
* Algorithms</a> are available via {@link Jwks.HASH}.</p>
|
* Algorithms</a> are available via {@link Jwks.HASH}.</p>
|
||||||
*
|
*
|
||||||
* @see Jwks.HASH
|
* @see Jwks.HASH
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface HashAlgorithm extends DigestAlgorithm<Request<InputStream>, VerifyDigestRequest> {
|
public interface HashAlgorithm extends DigestAlgorithm<Request<InputStream>, VerifyDigestRequest> {
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ public class InvalidKeyException extends KeyException {
|
||||||
*
|
*
|
||||||
* @param message the message explaining why the exception is thrown.
|
* @param message the message explaining why the exception is thrown.
|
||||||
* @param cause the underlying cause that resulted in this exception being thrown.
|
* @param cause the underlying cause that resulted in this exception being thrown.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public InvalidKeyException(String message, Throwable cause) {
|
public InvalidKeyException(String message, Throwable cause) {
|
||||||
super(message, cause);
|
super(message, cause);
|
||||||
|
|
|
@ -21,7 +21,7 @@ package io.jsonwebtoken.security;
|
||||||
* algorithms, a <em>new</em> secure-random Initialization Vector <em>MUST</em> be generated for every individual
|
* algorithms, a <em>new</em> secure-random Initialization Vector <em>MUST</em> be generated for every individual
|
||||||
* encryption attempt.
|
* encryption attempt.
|
||||||
*
|
*
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface IvSupplier {
|
public interface IvSupplier {
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ import java.util.Set;
|
||||||
* JWK internal serialization parameters.</p>
|
* JWK internal serialization parameters.</p>
|
||||||
*
|
*
|
||||||
* @param <K> The type of Java {@link Key} represented by this JWK
|
* @param <K> The type of Java {@link Key} represented by this JWK
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface Jwk<K extends Key> extends Identifiable, Map<String, Object> {
|
public interface Jwk<K extends Key> extends Identifiable, Map<String, Object> {
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ import java.security.Key;
|
||||||
* @see EcPrivateJwkBuilder
|
* @see EcPrivateJwkBuilder
|
||||||
* @see OctetPublicJwkBuilder
|
* @see OctetPublicJwkBuilder
|
||||||
* @see OctetPrivateJwkBuilder
|
* @see OctetPrivateJwkBuilder
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface JwkBuilder<K extends Key, J extends Jwk<K>, T extends JwkBuilder<K, J, T>>
|
public interface JwkBuilder<K extends Key, J extends Jwk<K>, T extends JwkBuilder<K, J, T>>
|
||||||
extends MapMutator<String, Object, T>, SecurityBuilder<J, T>, KeyOperationPolicied<T> {
|
extends MapMutator<String, Object, T>, SecurityBuilder<J, T>, KeyOperationPolicied<T> {
|
||||||
|
|
|
@ -29,7 +29,7 @@ import io.jsonwebtoken.io.ParserBuilder;
|
||||||
* .build()
|
* .build()
|
||||||
* .parse(jwkString);</pre></blockquote>
|
* .parse(jwkString);</pre></blockquote>
|
||||||
*
|
*
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface JwkParserBuilder extends ParserBuilder<Jwk<?>, JwkParserBuilder>, KeyOperationPolicied<JwkParserBuilder> {
|
public interface JwkParserBuilder extends ParserBuilder<Jwk<?>, JwkParserBuilder>, KeyOperationPolicied<JwkParserBuilder> {
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ import java.util.Set;
|
||||||
* {@link Map#remove(Object) remove}, {@link Map#clear() clear}, etc) will throw an
|
* {@link Map#remove(Object) remove}, {@link Map#clear() clear}, etc) will throw an
|
||||||
* {@link UnsupportedOperationException}.</p>
|
* {@link UnsupportedOperationException}.</p>
|
||||||
*
|
*
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface JwkSet extends Map<String, Object>, Iterable<Jwk<?>> {
|
public interface JwkSet extends Map<String, Object>, Iterable<Jwk<?>> {
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ import java.util.Collection;
|
||||||
*
|
*
|
||||||
* @see #operationPolicy(KeyOperationPolicy)
|
* @see #operationPolicy(KeyOperationPolicy)
|
||||||
* @see #provider(Provider)
|
* @see #provider(Provider)
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface JwkSetBuilder extends MapMutator<String, Object, JwkSetBuilder>,
|
public interface JwkSetBuilder extends MapMutator<String, Object, JwkSetBuilder>,
|
||||||
SecurityBuilder<JwkSet, JwkSetBuilder>, KeyOperationPolicied<JwkSetBuilder> {
|
SecurityBuilder<JwkSet, JwkSetBuilder>, KeyOperationPolicied<JwkSetBuilder> {
|
||||||
|
|
|
@ -30,7 +30,7 @@ import io.jsonwebtoken.io.ParserBuilder;
|
||||||
* .build()
|
* .build()
|
||||||
* .parse(jwkSetString);</pre></blockquote>
|
* .parse(jwkSetString);</pre></blockquote>
|
||||||
*
|
*
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface JwkSetParserBuilder extends ParserBuilder<JwkSet, JwkSetParserBuilder>, KeyOperationPolicied<JwkSetParserBuilder> {
|
public interface JwkSetParserBuilder extends ParserBuilder<JwkSet, JwkSetParserBuilder>, KeyOperationPolicied<JwkSetParserBuilder> {
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ import java.net.URI;
|
||||||
* A canonical cryptographic digest of a JWK as defined by the
|
* A canonical cryptographic digest of a JWK as defined by the
|
||||||
* <a href="https://www.rfc-editor.org/rfc/rfc7638">JSON Web Key (JWK) Thumbprint</a> specification.
|
* <a href="https://www.rfc-editor.org/rfc/rfc7638">JSON Web Key (JWK) Thumbprint</a> specification.
|
||||||
*
|
*
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface JwkThumbprint {
|
public interface JwkThumbprint {
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ import io.jsonwebtoken.lang.Registry;
|
||||||
* Jwks.{@link Jwks.HASH HASH}.// press hotkeys to suggest individual hash algorithms or utility methods</pre></blockquote>
|
* Jwks.{@link Jwks.HASH HASH}.// press hotkeys to suggest individual hash algorithms or utility methods</pre></blockquote>
|
||||||
*
|
*
|
||||||
* @see #builder()
|
* @see #builder()
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public final class Jwks {
|
public final class Jwks {
|
||||||
|
|
||||||
|
@ -143,7 +143,7 @@ public final class Jwks {
|
||||||
* <p>They are also available together as a {@link Registry} instance via the {@link #get()} method.</p>
|
* <p>They are also available together as a {@link Registry} instance via the {@link #get()} method.</p>
|
||||||
*
|
*
|
||||||
* @see #get()
|
* @see #get()
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public static final class CRV {
|
public static final class CRV {
|
||||||
|
|
||||||
|
@ -268,7 +268,7 @@ public final class Jwks {
|
||||||
* <p>They are also available together as a {@link Registry} instance via the {@link #get()} method.</p>
|
* <p>They are also available together as a {@link Registry} instance via the {@link #get()} method.</p>
|
||||||
*
|
*
|
||||||
* @see #get()
|
* @see #get()
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public static final class HASH {
|
public static final class HASH {
|
||||||
|
|
||||||
|
@ -363,7 +363,7 @@ public final class Jwks {
|
||||||
* <p>They are also available together as a {@link Registry} instance via the {@link #get()} method.</p>
|
* <p>They are also available together as a {@link Registry} instance via the {@link #get()} method.</p>
|
||||||
*
|
*
|
||||||
* @see #get()
|
* @see #get()
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public static final class OP {
|
public static final class OP {
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ import java.security.Key;
|
||||||
* @param <D> The type of key to use to obtain the AEAD decryption key
|
* @param <D> The type of key to use to obtain the AEAD decryption key
|
||||||
* @see Jwts.KEY
|
* @see Jwts.KEY
|
||||||
* @see <a href="https://tools.ietf.org/html/rfc7516#section-2">RFC 7561, Section 2: JWE Key (Management) Algorithms</a>
|
* @see <a href="https://tools.ietf.org/html/rfc7516#section-2">RFC 7561, Section 2: JWE Key (Management) Algorithms</a>
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("JavadocLinkAsPlainText")
|
@SuppressWarnings("JavadocLinkAsPlainText")
|
||||||
public interface KeyAlgorithm<E extends Key, D extends Key> extends Identifiable {
|
public interface KeyAlgorithm<E extends Key, D extends Key> extends Identifiable {
|
||||||
|
|
|
@ -28,7 +28,7 @@ import java.security.Key;
|
||||||
* @param <K> the type of key to build
|
* @param <K> the type of key to build
|
||||||
* @param <B> the type of the builder, for subtype method chaining
|
* @param <B> the type of the builder, for subtype method chaining
|
||||||
* @see KeyBuilderSupplier
|
* @see KeyBuilderSupplier
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface KeyBuilder<K extends Key, B extends KeyBuilder<K, B>> extends SecurityBuilder<K, B> {
|
public interface KeyBuilder<K extends Key, B extends KeyBuilder<K, B>> extends SecurityBuilder<K, B> {
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ import java.security.Key;
|
||||||
* @param <B> type of builder to create each time {@link #key()} is called.
|
* @param <B> type of builder to create each time {@link #key()} is called.
|
||||||
* @see #key()
|
* @see #key()
|
||||||
* @see KeyBuilder
|
* @see KeyBuilder
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface KeyBuilderSupplier<K extends Key, B extends KeyBuilder<K, B>> {
|
public interface KeyBuilderSupplier<K extends Key, B extends KeyBuilder<K, B>> {
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ package io.jsonwebtoken.security;
|
||||||
/**
|
/**
|
||||||
* Provides access to the required length in bits <em>(not bytes)</em> of keys usable with the associated algorithm.
|
* Provides access to the required length in bits <em>(not bytes)</em> of keys usable with the associated algorithm.
|
||||||
*
|
*
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface KeyLengthSupplier {
|
public interface KeyLengthSupplier {
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ import io.jsonwebtoken.Identifiable;
|
||||||
*
|
*
|
||||||
* @see <a href="https://www.rfc-editor.org/rfc/rfc7517.html#section-4.3">JWK key_ops (Key Operations) Parameter</a>
|
* @see <a href="https://www.rfc-editor.org/rfc/rfc7517.html#section-4.3">JWK key_ops (Key Operations) Parameter</a>
|
||||||
* @see <a href="https://datatracker.ietf.org/doc/html/rfc7517#section-8.3">JSON Web Key Operations Registry</a>
|
* @see <a href="https://datatracker.ietf.org/doc/html/rfc7517#section-8.3">JSON Web Key Operations Registry</a>
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface KeyOperation extends Identifiable {
|
public interface KeyOperation extends Identifiable {
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ import io.jsonwebtoken.lang.Builder;
|
||||||
* @see Jwks.OP#builder()
|
* @see Jwks.OP#builder()
|
||||||
* @see Jwks.OP#policy()
|
* @see Jwks.OP#policy()
|
||||||
* @see JwkBuilder#operationPolicy(KeyOperationPolicy)
|
* @see JwkBuilder#operationPolicy(KeyOperationPolicy)
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface KeyOperationBuilder extends Builder<KeyOperation> {
|
public interface KeyOperationBuilder extends Builder<KeyOperation> {
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ import java.util.Collection;
|
||||||
* A key operation policy determines which {@link KeyOperation}s may be assigned to a JWK.
|
* A key operation policy determines which {@link KeyOperation}s may be assigned to a JWK.
|
||||||
*
|
*
|
||||||
* @see JwkBuilder#operationPolicy(KeyOperationPolicy)
|
* @see JwkBuilder#operationPolicy(KeyOperationPolicy)
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface KeyOperationPolicy {
|
public interface KeyOperationPolicy {
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ import java.util.Collection;
|
||||||
* @see Jwks.OP#policy()
|
* @see Jwks.OP#policy()
|
||||||
* @see JwkBuilder#operationPolicy(KeyOperationPolicy)
|
* @see JwkBuilder#operationPolicy(KeyOperationPolicy)
|
||||||
* @see Jwks.OP#builder()
|
* @see Jwks.OP#builder()
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface KeyOperationPolicyBuilder extends CollectionMutator<KeyOperation, KeyOperationPolicyBuilder>,
|
public interface KeyOperationPolicyBuilder extends CollectionMutator<KeyOperation, KeyOperationPolicyBuilder>,
|
||||||
Builder<KeyOperationPolicy> {
|
Builder<KeyOperationPolicy> {
|
||||||
|
|
|
@ -24,7 +24,7 @@ import java.security.PublicKey;
|
||||||
*
|
*
|
||||||
* @param <A> The type of {@link PublicKey} in the key pair.
|
* @param <A> The type of {@link PublicKey} in the key pair.
|
||||||
* @param <B> The type of {@link PrivateKey} in the key pair.
|
* @param <B> The type of {@link PrivateKey} in the key pair.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface KeyPair<A extends PublicKey, B extends PrivateKey> {
|
public interface KeyPair<A extends PublicKey, B extends PrivateKey> {
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ import java.security.KeyPair;
|
||||||
* ensuring the resulting {@link KeyPair}s are compatible with their associated cryptographic algorithm.</p>
|
* ensuring the resulting {@link KeyPair}s are compatible with their associated cryptographic algorithm.</p>
|
||||||
*
|
*
|
||||||
* @see KeyPairBuilderSupplier
|
* @see KeyPairBuilderSupplier
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface KeyPairBuilder extends SecurityBuilder<KeyPair, KeyPairBuilder> {
|
public interface KeyPairBuilder extends SecurityBuilder<KeyPair, KeyPairBuilder> {
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ import java.security.KeyPair;
|
||||||
*
|
*
|
||||||
* @see #keyPair()
|
* @see #keyPair()
|
||||||
* @see KeyPairBuilder
|
* @see KeyPairBuilder
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface KeyPairBuilderSupplier {
|
public interface KeyPairBuilderSupplier {
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ import io.jsonwebtoken.JweHeader;
|
||||||
*
|
*
|
||||||
* @param <T> the type of object relevant during key algorithm cryptographic operations.
|
* @param <T> the type of object relevant during key algorithm cryptographic operations.
|
||||||
* @see DecryptionKeyRequest
|
* @see DecryptionKeyRequest
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface KeyRequest<T> extends Request<T> {
|
public interface KeyRequest<T> extends Request<T> {
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ import javax.crypto.SecretKey;
|
||||||
* <p>The result {@link #getKey() key} is the {@code JWE Content Encryption Key (CEK)} which will be used to encrypt
|
* <p>The result {@link #getKey() key} is the {@code JWE Content Encryption Key (CEK)} which will be used to encrypt
|
||||||
* the JWE.</p>
|
* the JWE.</p>
|
||||||
*
|
*
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface KeyResult extends Message<byte[]>, KeySupplier<SecretKey> {
|
public interface KeyResult extends Message<byte[]>, KeySupplier<SecretKey> {
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ import java.security.Key;
|
||||||
* Provides access to a cryptographic {@link Key} necessary for signing, wrapping, encryption or decryption algorithms.
|
* Provides access to a cryptographic {@link Key} necessary for signing, wrapping, encryption or decryption algorithms.
|
||||||
*
|
*
|
||||||
* @param <K> the type of key provided by this supplier.
|
* @param <K> the type of key provided by this supplier.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface KeySupplier<K extends Key> {
|
public interface KeySupplier<K extends Key> {
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,7 @@ public final class Keys {
|
||||||
/**
|
/**
|
||||||
* <p><b>Deprecation Notice</b></p>
|
* <p><b>Deprecation Notice</b></p>
|
||||||
*
|
*
|
||||||
* <p>As of JJWT JJWT_RELEASE_VERSION, symmetric (secret) key algorithm instances can generate a key of suitable
|
* <p>As of JJWT 0.12.0, symmetric (secret) key algorithm instances can generate a key of suitable
|
||||||
* length for that specific algorithm by calling their {@code key()} builder method directly. For example:</p>
|
* length for that specific algorithm by calling their {@code key()} builder method directly. For example:</p>
|
||||||
*
|
*
|
||||||
* <pre><code>
|
* <pre><code>
|
||||||
|
@ -132,7 +132,7 @@ public final class Keys {
|
||||||
* @return a new {@link SecretKey} instance suitable for use with the specified {@link SignatureAlgorithm}.
|
* @return a new {@link SecretKey} instance suitable for use with the specified {@link SignatureAlgorithm}.
|
||||||
* @throws IllegalArgumentException for any input value other than {@link io.jsonwebtoken.SignatureAlgorithm#HS256},
|
* @throws IllegalArgumentException for any input value other than {@link io.jsonwebtoken.SignatureAlgorithm#HS256},
|
||||||
* {@link io.jsonwebtoken.SignatureAlgorithm#HS384}, or {@link io.jsonwebtoken.SignatureAlgorithm#HS512}
|
* {@link io.jsonwebtoken.SignatureAlgorithm#HS384}, or {@link io.jsonwebtoken.SignatureAlgorithm#HS512}
|
||||||
* @deprecated since JJWT_RELEASE_VERSION. Use your preferred {@link MacAlgorithm} instance's
|
* @deprecated since 0.12.0. Use your preferred {@link MacAlgorithm} instance's
|
||||||
* {@link MacAlgorithm#key() key()} builder method directly.
|
* {@link MacAlgorithm#key() key()} builder method directly.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("DeprecatedIsStillUsed")
|
@SuppressWarnings("DeprecatedIsStillUsed")
|
||||||
|
@ -150,7 +150,7 @@ public final class Keys {
|
||||||
/**
|
/**
|
||||||
* <p><b>Deprecation Notice</b></p>
|
* <p><b>Deprecation Notice</b></p>
|
||||||
*
|
*
|
||||||
* <p>As of JJWT JJWT_RELEASE_VERSION, asymmetric key algorithm instances can generate KeyPairs of suitable strength
|
* <p>As of JJWT 0.12.0, asymmetric key algorithm instances can generate KeyPairs of suitable strength
|
||||||
* for that specific algorithm by calling their {@code keyPair()} builder method directly. For example:</p>
|
* for that specific algorithm by calling their {@code keyPair()} builder method directly. For example:</p>
|
||||||
*
|
*
|
||||||
* <blockquote><pre>
|
* <blockquote><pre>
|
||||||
|
@ -236,7 +236,7 @@ public final class Keys {
|
||||||
* @param alg the {@code SignatureAlgorithm} to inspect to determine which asymmetric algorithm to use.
|
* @param alg the {@code SignatureAlgorithm} to inspect to determine which asymmetric algorithm to use.
|
||||||
* @return a new {@link KeyPair} suitable for use with the specified asymmetric algorithm.
|
* @return a new {@link KeyPair} suitable for use with the specified asymmetric algorithm.
|
||||||
* @throws IllegalArgumentException if {@code alg} is not an asymmetric algorithm
|
* @throws IllegalArgumentException if {@code alg} is not an asymmetric algorithm
|
||||||
* @deprecated since JJWT_RELEASE_VERSION in favor of your preferred
|
* @deprecated since 0.12.0 in favor of your preferred
|
||||||
* {@link io.jsonwebtoken.security.SignatureAlgorithm} instance's
|
* {@link io.jsonwebtoken.security.SignatureAlgorithm} instance's
|
||||||
* {@link SignatureAlgorithm#keyPair() keyPair()} builder method directly.
|
* {@link SignatureAlgorithm#keyPair() keyPair()} builder method directly.
|
||||||
*/
|
*/
|
||||||
|
@ -271,7 +271,7 @@ public final class Keys {
|
||||||
* @param password the raw password character array to clone for use with password-based key derivation algorithms.
|
* @param password the raw password character array to clone for use with password-based key derivation algorithms.
|
||||||
* @return a new {@link Password} instance that wraps a new clone of the specified {@code password} character array.
|
* @return a new {@link Password} instance that wraps a new clone of the specified {@code password} character array.
|
||||||
* @see Password#toCharArray()
|
* @see Password#toCharArray()
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public static Password password(char[] password) {
|
public static Password password(char[] password) {
|
||||||
return invokeStatic("password", FOR_PASSWORD_ARG_TYPES, new Object[]{password});
|
return invokeStatic("password", FOR_PASSWORD_ARG_TYPES, new Object[]{password});
|
||||||
|
@ -296,7 +296,7 @@ public final class Keys {
|
||||||
* {@link Provider}
|
* {@link Provider}
|
||||||
* @return a new {@code SecretKeyBuilder} that produces the specified key, potentially associated with any
|
* @return a new {@code SecretKeyBuilder} that produces the specified key, potentially associated with any
|
||||||
* specified provider.
|
* specified provider.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public static SecretKeyBuilder builder(SecretKey key) {
|
public static SecretKeyBuilder builder(SecretKey key) {
|
||||||
Assert.notNull(key, "SecretKey cannot be null.");
|
Assert.notNull(key, "SecretKey cannot be null.");
|
||||||
|
@ -323,7 +323,7 @@ public final class Keys {
|
||||||
* {@link Provider} or {@link PublicKey}.
|
* {@link Provider} or {@link PublicKey}.
|
||||||
* @return a new {@code PrivateKeyBuilder} that produces the specified private key, potentially associated with any
|
* @return a new {@code PrivateKeyBuilder} that produces the specified private key, potentially associated with any
|
||||||
* specified provider or {@code PublicKey}
|
* specified provider or {@code PublicKey}
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public static PrivateKeyBuilder builder(PrivateKey key) {
|
public static PrivateKeyBuilder builder(PrivateKey key) {
|
||||||
Assert.notNull(key, "PrivateKey cannot be null.");
|
Assert.notNull(key, "PrivateKey cannot be null.");
|
||||||
|
|
|
@ -58,7 +58,7 @@ import javax.crypto.SecretKey;
|
||||||
* available via {@link io.jsonwebtoken.Jwts.SIG Jwts.SIG}.</p>
|
* available via {@link io.jsonwebtoken.Jwts.SIG Jwts.SIG}.</p>
|
||||||
*
|
*
|
||||||
* @see io.jsonwebtoken.Jwts.SIG Jwts.SIG
|
* @see io.jsonwebtoken.Jwts.SIG Jwts.SIG
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface MacAlgorithm extends SecureDigestAlgorithm<SecretKey, SecretKey>,
|
public interface MacAlgorithm extends SecureDigestAlgorithm<SecretKey, SecretKey>,
|
||||||
KeyBuilderSupplier<SecretKey, SecretKeyBuilder>, KeyLengthSupplier {
|
KeyBuilderSupplier<SecretKey, SecretKeyBuilder>, KeyLengthSupplier {
|
||||||
|
|
|
@ -19,7 +19,7 @@ package io.jsonwebtoken.security;
|
||||||
* Exception thrown when encountering a key or key material that is incomplete or improperly configured or
|
* Exception thrown when encountering a key or key material that is incomplete or improperly configured or
|
||||||
* formatted and cannot be used as expected.
|
* formatted and cannot be used as expected.
|
||||||
*
|
*
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public class MalformedKeyException extends InvalidKeyException {
|
public class MalformedKeyException extends InvalidKeyException {
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ package io.jsonwebtoken.security;
|
||||||
* Exception thrown when encountering a {@link JwkSet} that is incomplete or improperly configured or
|
* Exception thrown when encountering a {@link JwkSet} that is incomplete or improperly configured or
|
||||||
* formatted and cannot be used as expected.
|
* formatted and cannot be used as expected.
|
||||||
*
|
*
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public class MalformedKeySetException extends SecurityException {
|
public class MalformedKeySetException extends SecurityException {
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ import java.security.Key;
|
||||||
* A message contains a {@link #getPayload() payload} used as input to or output from a cryptographic algorithm.
|
* A message contains a {@link #getPayload() payload} used as input to or output from a cryptographic algorithm.
|
||||||
*
|
*
|
||||||
* @param <T> The type of payload in the message.
|
* @param <T> The type of payload in the message.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface Message<T> {
|
public interface Message<T> {
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ import java.security.interfaces.ECPrivateKey;
|
||||||
* @param <K> The type of Edwards-curve {@link PrivateKey} represented by this JWK (e.g. XECPrivateKey, EdECPrivateKey, etc).
|
* @param <K> The type of Edwards-curve {@link PrivateKey} represented by this JWK (e.g. XECPrivateKey, EdECPrivateKey, etc).
|
||||||
* @param <L> The type of Edwards-curve {@link PublicKey} represented by the JWK's corresponding
|
* @param <L> The type of Edwards-curve {@link PublicKey} represented by the JWK's corresponding
|
||||||
* {@link #toPublicJwk() public JWK}, for example XECPublicKey, EdECPublicKey, etc.
|
* {@link #toPublicJwk() public JWK}, for example XECPublicKey, EdECPublicKey, etc.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface OctetPrivateJwk<K extends PrivateKey, L extends PublicKey> extends PrivateJwk<K, L, OctetPublicJwk<L>> {
|
public interface OctetPrivateJwk<K extends PrivateKey, L extends PublicKey> extends PrivateJwk<K, L, OctetPublicJwk<L>> {
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ import java.security.PublicKey;
|
||||||
*
|
*
|
||||||
* @param <K> The type of {@link PrivateKey} represented by the constructed {@link OctetPrivateJwk} instance.
|
* @param <K> The type of {@link PrivateKey} represented by the constructed {@link OctetPrivateJwk} instance.
|
||||||
* @param <L> The type of {@link PublicKey} available from the constructed {@link OctetPrivateJwk}'s associated {@link PrivateJwk#toPublicJwk() public JWK} properties.
|
* @param <L> The type of {@link PublicKey} available from the constructed {@link OctetPrivateJwk}'s associated {@link PrivateJwk#toPublicJwk() public JWK} properties.
|
||||||
* @since JJWT_RELEASE_VERSION
|
* @since 0.12.0
|
||||||
*/
|
*/
|
||||||
public interface OctetPrivateJwkBuilder<K extends PrivateKey, L extends PublicKey> extends
|
public interface OctetPrivateJwkBuilder<K extends PrivateKey, L extends PublicKey> extends
|
||||||
PrivateJwkBuilder<K, L, OctetPublicJwk<L>, OctetPrivateJwk<K, L>, OctetPrivateJwkBuilder<K, L>> {
|
PrivateJwkBuilder<K, L, OctetPublicJwk<L>, OctetPrivateJwk<K, L>, OctetPrivateJwkBuilder<K, L>> {
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue