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
|
||||
|
||||
### 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
|
||||
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>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
<artifactId>jjwt-api</artifactId>
|
||||
<version>JJWT_RELEASE_VERSION</version>
|
||||
<version>0.12.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
<artifactId>jjwt-impl</artifactId>
|
||||
<version>JJWT_RELEASE_VERSION</version>
|
||||
<version>0.12.0</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
<artifactId>jjwt-jackson</artifactId> <!-- or jjwt-gson if Gson is preferred -->
|
||||
<version>JJWT_RELEASE_VERSION</version>
|
||||
<version>0.12.0</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<!-- 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
|
||||
dependencies {
|
||||
implementation 'io.jsonwebtoken:jjwt-api:JJWT_RELEASE_VERSION'
|
||||
runtimeOnly 'io.jsonwebtoken:jjwt-impl:JJWT_RELEASE_VERSION'
|
||||
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:JJWT_RELEASE_VERSION' // or 'io.jsonwebtoken:jjwt-gson:JJWT_RELEASE_VERSION' for gson
|
||||
implementation 'io.jsonwebtoken:jjwt-api:0.12.0'
|
||||
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.12.0'
|
||||
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:
|
||||
- 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
|
||||
dependencies {
|
||||
api('io.jsonwebtoken:jjwt-api:JJWT_RELEASE_VERSION')
|
||||
runtimeOnly('io.jsonwebtoken:jjwt-impl:JJWT_RELEASE_VERSION')
|
||||
runtimeOnly('io.jsonwebtoken:jjwt-orgjson:JJWT_RELEASE_VERSION') {
|
||||
api('io.jsonwebtoken:jjwt-api:0.12.0')
|
||||
runtimeOnly('io.jsonwebtoken:jjwt-impl:0.12.0')
|
||||
runtimeOnly('io.jsonwebtoken:jjwt-orgjson:0.12.0') {
|
||||
exclude(group: 'org.json', module: 'json') //provided by Android natively
|
||||
}
|
||||
/*
|
||||
|
@ -2952,7 +2952,7 @@ scope which is the typical JJWT default). That is:
|
|||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
<artifactId>jjwt-jackson</artifactId>
|
||||
<version>JJWT_RELEASE_VERSION</version>
|
||||
<version>0.12.0</version>
|
||||
<scope>compile</scope> <!-- Not runtime -->
|
||||
</dependency>
|
||||
```
|
||||
|
@ -2961,7 +2961,7 @@ scope which is the typical JJWT default). That is:
|
|||
|
||||
```groovy
|
||||
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>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
<artifactId>jjwt-gson</artifactId>
|
||||
<version>JJWT_RELEASE_VERSION</version>
|
||||
<version>0.12.0</version>
|
||||
<scope>compile</scope> <!-- Not runtime -->
|
||||
</dependency>
|
||||
```
|
||||
|
@ -3078,7 +3078,7 @@ scope which is the typical JJWT default). That is:
|
|||
|
||||
```groovy
|
||||
dependencies {
|
||||
implementation 'io.jsonwebtoken:jjwt-gson:JJWT_RELEASE_VERSION'
|
||||
implementation 'io.jsonwebtoken:jjwt-gson:0.12.0'
|
||||
}
|
||||
```
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<parent>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
<artifactId>jjwt-root</artifactId>
|
||||
<version>0.11.6-SNAPSHOT</version>
|
||||
<version>0.13.0-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import io.jsonwebtoken.lang.MapMutator;
|
|||
*
|
||||
* @see JwtBuilder
|
||||
* @see Claims
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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.
|
||||
* @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.
|
||||
*/
|
||||
@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.
|
||||
* @return the {@code Claims} instance for method chaining.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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.
|
||||
* @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.
|
||||
*/
|
||||
@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.
|
||||
* @return the {@code Claims} instance for method chaining.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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.
|
||||
* @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.
|
||||
*/
|
||||
@Deprecated
|
||||
|
@ -99,7 +99,7 @@ public interface ClaimsMutator<T extends ClaimsMutator<T>> {
|
|||
* @return the {@link AudienceCollection AudienceCollection} to use for {@code aud} configuration.
|
||||
* @see AudienceCollection AudienceCollection
|
||||
* @see AudienceCollection#single(String) AudienceCollection.single(String)
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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.
|
||||
* @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.
|
||||
*/
|
||||
@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.
|
||||
* @return the {@code Claims} instance for method chaining.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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.
|
||||
* @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.
|
||||
*/
|
||||
@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.
|
||||
* @return the {@code Claims} instance for method chaining.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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.
|
||||
* @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.
|
||||
*/
|
||||
@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.
|
||||
* @return the {@code Claims} instance for method chaining.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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.
|
||||
* @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.
|
||||
*/
|
||||
@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.
|
||||
* @return the {@code Claims} instance for method chaining.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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.
|
||||
* @see #single(String)
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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
|
||||
* {@code null}, empty or whitespace to remove the property from the JSON map.
|
||||
* @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,
|
||||
* 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#GZIP
|
||||
* @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
|
||||
public interface CompressionCodec extends CompressionAlgorithm {
|
||||
|
@ -40,7 +40,7 @@ public interface CompressionCodec extends CompressionAlgorithm {
|
|||
*
|
||||
* @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.
|
||||
* @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.
|
||||
*/
|
||||
@SuppressWarnings("DeprecatedIsStillUsed")
|
||||
|
|
|
@ -47,21 +47,21 @@ public interface Header extends Map<String, Object> {
|
|||
/**
|
||||
* 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
|
||||
String JWT_TYPE = "JWT";
|
||||
|
||||
/**
|
||||
* 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
|
||||
String TYPE = "typ";
|
||||
|
||||
/**
|
||||
* 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
|
||||
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/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
|
||||
String ALGORITHM = "alg";
|
||||
|
||||
/**
|
||||
* 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
|
||||
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
|
||||
* {@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();
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ import io.jsonwebtoken.lang.MapMutator;
|
|||
* Mutation (modifications) to a {@link Header Header} instance.
|
||||
*
|
||||
* @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> {
|
||||
|
||||
|
@ -47,7 +47,7 @@ public interface HeaderMutator<T extends HeaderMutator<T>> extends MapMutator<St
|
|||
*
|
||||
* @param alg the {@code alg} header value
|
||||
* @return this header for method chaining
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*
|
||||
T algorithm(String alg);
|
||||
*/
|
||||
|
@ -95,36 +95,36 @@ public interface HeaderMutator<T extends HeaderMutator<T>> extends MapMutator<St
|
|||
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.
|
||||
* @return the instance for method chaining.
|
||||
* @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.
|
||||
*/
|
||||
@Deprecated
|
||||
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.
|
||||
* @return the instance for method chaining.
|
||||
* @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
|
||||
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.
|
||||
*
|
||||
* @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.
|
||||
* @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
|
||||
T setCompressionAlgorithm(String zip);
|
||||
|
|
|
@ -79,7 +79,7 @@ package io.jsonwebtoken;
|
|||
* </tbody>
|
||||
* </table>
|
||||
*
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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>.
|
||||
*
|
||||
* @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> {
|
||||
|
||||
|
@ -30,7 +30,7 @@ public interface Jwe<B> extends ProtectedJwt<JweHeader, B> {
|
|||
* {@link UnsupportedJwtException}.
|
||||
*
|
||||
* @see SupportedJwtVisitor#onDecryptedContent(Jwe)
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@SuppressWarnings("UnnecessaryModifier")
|
||||
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}.
|
||||
*
|
||||
* @see SupportedJwtVisitor#onDecryptedClaims(Jwe)
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@SuppressWarnings("UnnecessaryModifier")
|
||||
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.
|
||||
*
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
public interface JweHeader extends ProtectedHeader {
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ import io.jsonwebtoken.security.KeyAlgorithm;
|
|||
* Mutation (modifications) to a {@link JweHeader} instance.
|
||||
*
|
||||
* @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> {
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ public interface Jws<P> extends ProtectedJwt<JwsHeader, P> {
|
|||
* {@link UnsupportedJwtException}.
|
||||
*
|
||||
* @see SupportedJwtVisitor#onVerifiedContent(Jws)
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@SuppressWarnings("UnnecessaryModifier")
|
||||
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}.
|
||||
*
|
||||
* @see SupportedJwtVisitor#onVerifiedClaims(Jws)
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@SuppressWarnings("UnnecessaryModifier")
|
||||
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.
|
||||
*
|
||||
* @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
|
||||
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>
|
||||
*
|
||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #getAlgorithm()}
|
||||
* @deprecated since 0.12.0 in favor of {@link #getAlgorithm()}
|
||||
*/
|
||||
@Deprecated
|
||||
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>
|
||||
*
|
||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #getJwkSetUrl()}
|
||||
* @deprecated since 0.12.0 in favor of {@link #getJwkSetUrl()}
|
||||
*/
|
||||
@Deprecated
|
||||
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>
|
||||
*
|
||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #getJwk()}
|
||||
* @deprecated since 0.12.0 in favor of {@link #getJwk()}
|
||||
*/
|
||||
@Deprecated
|
||||
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>
|
||||
*
|
||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #getKeyId()}
|
||||
* @deprecated since 0.12.0 in favor of {@link #getKeyId()}
|
||||
*/
|
||||
@Deprecated
|
||||
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>
|
||||
*
|
||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #getX509Url()}
|
||||
* @deprecated since 0.12.0 in favor of {@link #getX509Url()}
|
||||
*/
|
||||
@Deprecated
|
||||
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>
|
||||
*
|
||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #getX509Chain()}
|
||||
* @deprecated since 0.12.0 in favor of {@link #getX509Chain()}
|
||||
*/
|
||||
@Deprecated
|
||||
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>
|
||||
*
|
||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #getX509Sha1Thumbprint()}
|
||||
* @deprecated since 0.12.0 in favor of {@link #getX509Sha1Thumbprint()}
|
||||
*/
|
||||
@Deprecated
|
||||
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>
|
||||
*
|
||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #getX509Sha256Thumbprint()}
|
||||
* @deprecated since 0.12.0 in favor of {@link #getX509Sha256Thumbprint()}
|
||||
*/
|
||||
@Deprecated
|
||||
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>
|
||||
*
|
||||
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link #getCritical()}
|
||||
* @deprecated since 0.12.0 in favor of {@link #getCritical()}
|
||||
*/
|
||||
@Deprecated
|
||||
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}.
|
||||
*
|
||||
* @see SupportedJwtVisitor#onUnsecuredContent(Jwt)
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@SuppressWarnings("UnnecessaryModifier")
|
||||
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}.
|
||||
*
|
||||
* @see SupportedJwtVisitor#onUnsecuredClaims(Jwt)
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@SuppressWarnings("UnnecessaryModifier")
|
||||
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.
|
||||
*
|
||||
* @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
|
||||
* nomenclature/taxonomy.
|
||||
*/
|
||||
|
@ -81,7 +81,7 @@ public interface Jwt<H extends Header, P> {
|
|||
* the final content type as desired.
|
||||
*
|
||||
* @return the JWT payload, either a {@code byte[]} or a {@code Claims} instance.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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
|
||||
* JCA subsystem preferred provider should be used.
|
||||
* @return the builder for method chaining.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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
|
||||
* {@code null} if a default {@link SecureRandom} should be used.
|
||||
* @return the builder for method chaining.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
JwtBuilder random(SecureRandom secureRandom);
|
||||
|
||||
|
@ -92,7 +92,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
|
|||
* .compact();</pre></blockquote>
|
||||
*
|
||||
* @return the {@link BuilderHeader} to use for header construction.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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.
|
||||
* @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>
|
||||
* (to replace all header parameters) or
|
||||
* <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.
|
||||
* @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>.
|
||||
* 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 value the header parameter value
|
||||
* @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>.
|
||||
* 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);
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @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(byte[], String)
|
||||
* @see #content(InputStream, String)
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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
|
||||
* @return the builder for method chaining.
|
||||
* @see #content(byte[], String)
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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
|
||||
* @return the builder for method chaining.
|
||||
* @see #content(byte[], String)
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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.
|
||||
* @return the builder for method chaining.
|
||||
* @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;
|
||||
|
||||
|
@ -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.
|
||||
* @return the builder for method chaining.
|
||||
* @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;
|
||||
|
||||
|
@ -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.
|
||||
* @return the builder for method chaining.
|
||||
* @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;
|
||||
|
||||
|
@ -416,7 +416,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
|
|||
* .compact();</pre></blockquote>
|
||||
*
|
||||
* @return the {@link BuilderClaims} to use for Claims construction.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
BuilderClaims claims();
|
||||
|
||||
|
@ -434,7 +434,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
|
|||
* @see #content(String)
|
||||
* @see #content(byte[])
|
||||
* @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")
|
||||
@Deprecated
|
||||
|
@ -451,7 +451,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
|
|||
* @param claims the JWT Claims to be added to the JWT payload.
|
||||
* @return the builder for method chaining.
|
||||
* @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>.
|
||||
* 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.
|
||||
* @return the builder instance for method chaining
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
JwtBuilder claims(Map<String, ?> claims);
|
||||
|
||||
|
@ -815,7 +815,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
|
|||
/**
|
||||
* <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
|
||||
* are represented as instances of this new interface in the {@link Jwts.SIG}
|
||||
* algorithm registry.</p>
|
||||
|
@ -833,7 +833,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
|
|||
* the specified algorithm.
|
||||
* @see #signWith(Key)
|
||||
* @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
|
||||
JwtBuilder signWith(Key key, SignatureAlgorithm alg) throws InvalidKeyException;
|
||||
|
@ -856,7 +856,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
|
|||
* the specified algorithm.
|
||||
* @see #signWith(Key)
|
||||
* @see Jwts.SIG
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
<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.
|
||||
* @return the builder for method chaining.
|
||||
* @see Jwts.ZIP
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
JwtBuilder compressWith(CompressionAlgorithm alg);
|
||||
|
||||
|
@ -957,7 +957,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
|
|||
* @return the builder for method chaining.
|
||||
* @see #b64Url(Encoder)
|
||||
* @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")
|
||||
@Deprecated
|
||||
|
@ -974,7 +974,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
|
|||
*
|
||||
* @param encoder the encoder to use when Base64Url-encoding
|
||||
* @return the builder for method chaining.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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.
|
||||
* @return the builder for method chaining.
|
||||
* @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")
|
||||
@Deprecated
|
||||
|
@ -1019,7 +1019,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
|
|||
*
|
||||
* @param serializer the Serializer to use when converting Map objects to JSON strings.
|
||||
* @return the builder for method chaining.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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()}
|
||||
* method for continued configuration.
|
||||
*
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
interface BuilderClaims extends MapMutator<String, Object, BuilderClaims>, ClaimsMutator<BuilderClaims>,
|
||||
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
|
||||
* {@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>,
|
||||
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.
|
||||
* @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")
|
||||
@Deprecated
|
||||
|
@ -83,7 +83,7 @@ public interface JwtHandler<T> extends JwtVisitor<T> {
|
|||
*
|
||||
* @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.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
T onContentJwe(Jwe<byte[]> jwe);
|
||||
|
||||
|
@ -95,7 +95,7 @@ public interface JwtHandler<T> extends JwtVisitor<T> {
|
|||
*
|
||||
* @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.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
T onClaimsJwe(Jwe<Claims> jwe);
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ public interface JwtParser extends Parser<Jwt<?, ?>> {
|
|||
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
|
||||
* example:
|
||||
*
|
||||
|
@ -107,7 +107,7 @@ public interface JwtParser extends Parser<Jwt<?, ?>> {
|
|||
* {@code handler} is {@code null}.
|
||||
* @see Jwt#accept(JwtVisitor)
|
||||
* @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>
|
||||
*/
|
||||
@Deprecated
|
||||
|
@ -115,7 +115,7 @@ public interface JwtParser extends Parser<Jwt<?, ?>> {
|
|||
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>
|
||||
*
|
||||
|
@ -129,7 +129,7 @@ public interface JwtParser extends Parser<Jwt<?, ?>> {
|
|||
* @see #parseUnsecuredContent(CharSequence)
|
||||
* @see Jwt#accept(JwtVisitor)
|
||||
* @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")
|
||||
@Deprecated
|
||||
|
@ -137,7 +137,7 @@ public interface JwtParser extends Parser<Jwt<?, ?>> {
|
|||
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>
|
||||
*
|
||||
|
@ -151,7 +151,7 @@ public interface JwtParser extends Parser<Jwt<?, ?>> {
|
|||
* @see #parseUnsecuredClaims(CharSequence)
|
||||
* @see Jwt#accept(JwtVisitor)
|
||||
* @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")
|
||||
@Deprecated
|
||||
|
@ -159,7 +159,7 @@ public interface JwtParser extends Parser<Jwt<?, ?>> {
|
|||
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>
|
||||
*
|
||||
|
@ -174,7 +174,7 @@ public interface JwtParser extends Parser<Jwt<?, ?>> {
|
|||
* @see #parseEncryptedContent(CharSequence)
|
||||
* @see #parse(CharSequence)
|
||||
* @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")
|
||||
@Deprecated
|
||||
|
@ -182,7 +182,7 @@ public interface JwtParser extends Parser<Jwt<?, ?>> {
|
|||
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.
|
||||
* @return the parsed and validated Claims JWS
|
||||
|
@ -197,7 +197,7 @@ public interface JwtParser extends Parser<Jwt<?, ?>> {
|
|||
* @see #parseEncryptedClaims(CharSequence)
|
||||
* @see #parse(CharSequence)
|
||||
* @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")
|
||||
@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
|
||||
* @see #parse(CharSequence)
|
||||
* @see Jwt#accept(JwtVisitor)
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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
|
||||
* @see #parse(CharSequence)
|
||||
* @see Jwt#accept(JwtVisitor)
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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
|
||||
* @see #parse(CharSequence)
|
||||
* @see Jwt#accept(JwtVisitor)
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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 unencodedPayload the JWS's associated required unencoded payload used for signature verification.
|
||||
* @return the parsed Unencoded Payload.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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 unencodedPayload the JWS's associated required unencoded payload used for signature verification.
|
||||
* @return the parsed Unencoded Payload.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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
|
||||
* @see #parse(CharSequence)
|
||||
* @see Jwt#accept(JwtVisitor)
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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.
|
||||
* @throws JwtException if parsing, signature verification, or JWT validation fails.
|
||||
* @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;
|
||||
|
||||
|
@ -375,7 +375,7 @@ public interface JwtParser extends Parser<Jwt<?, ?>> {
|
|||
* @return the parsed and validated Claims JWS.
|
||||
* @throws JwtException if parsing, signature verification, or JWT validation fails.
|
||||
* @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;
|
||||
|
||||
|
@ -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
|
||||
* @see #parse(CharSequence)
|
||||
* @see Jwt#accept(JwtVisitor)
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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
|
||||
* @see #parse(CharSequence)
|
||||
* @see Jwt#accept(JwtVisitor)
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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 Jwts.SIG#NONE
|
||||
* @see #unsecuredDecompression()
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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>
|
||||
* @see Jwts.SIG#NONE
|
||||
* @see #unsecured()
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
JwtParserBuilder unsecuredDecompression();
|
||||
|
||||
|
@ -109,7 +109,7 @@ public interface JwtParserBuilder extends Builder<JwtParser> {
|
|||
*
|
||||
* @return the {@link NestedCollection} to use for {@code crit} configuration.
|
||||
* @see ProtectedHeader#getCritical()
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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}
|
||||
* if the JCA subsystem preferred provider should be used.
|
||||
* @return the builder for method chaining.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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.
|
||||
* @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.
|
||||
*/
|
||||
@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
|
||||
* any such value would cause numeric overflow when multiplying by 1000 to obtain
|
||||
* 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.
|
||||
*/
|
||||
@Deprecated
|
||||
|
@ -272,7 +272,7 @@ public interface JwtParserBuilder extends Builder<JwtParser> {
|
|||
/**
|
||||
* <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
|
||||
* {@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>
|
||||
|
@ -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
|
||||
* signature.
|
||||
* @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.
|
||||
*/
|
||||
@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,
|
||||
* 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
|
||||
* 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
|
||||
* signatures.
|
||||
* @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.
|
||||
*/
|
||||
@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.
|
||||
* @return the parser builder for method chaining.
|
||||
* @see #verifyWith(PublicKey)
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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.
|
||||
* @return the parser builder for method chaining.
|
||||
* @see #verifyWith(SecretKey)
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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.
|
||||
* @return the parser builder for method chaining.
|
||||
* @see #decryptWith(PrivateKey)
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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.
|
||||
* @return the parser builder for method chaining.
|
||||
* @see #decryptWith(SecretKey)
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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.
|
||||
* @return the parser builder for method chaining.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
JwtParserBuilder keyLocator(Locator<Key> keyLocator);
|
||||
|
||||
/**
|
||||
* <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
|
||||
* {@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>
|
||||
|
@ -542,7 +542,7 @@ public interface JwtParserBuilder extends Builder<JwtParser> {
|
|||
*
|
||||
* @param signingKeyResolver the signing key resolver used to retrieve the signing key.
|
||||
* @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")
|
||||
@Deprecated
|
||||
|
@ -585,7 +585,7 @@ public interface JwtParserBuilder extends Builder<JwtParser> {
|
|||
* @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/rfc7518.html#section-7.1.1">Encryption Algorithm Name (id) requirements</a>
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
NestedCollection<AeadAlgorithm, JwtParserBuilder> enc();
|
||||
|
||||
|
@ -625,7 +625,7 @@ public interface JwtParserBuilder extends Builder<JwtParser> {
|
|||
* @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/rfc7518.html#section-7.1.1">Key Algorithm Name (id) requirements</a>
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
NestedCollection<KeyAlgorithm<?, ?>, JwtParserBuilder> key();
|
||||
|
||||
|
@ -667,7 +667,7 @@ public interface JwtParserBuilder extends Builder<JwtParser> {
|
|||
* @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/rfc7518.html#section-7.1.1">Algorithm Name (id) requirements</a>
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
NestedCollection<SecureDigestAlgorithm<?, ?>, JwtParserBuilder> sig();
|
||||
|
||||
|
@ -707,14 +707,14 @@ public interface JwtParserBuilder extends Builder<JwtParser> {
|
|||
* @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/rfc7518.html#section-7.3.1">Compression Algorithm Name (id) requirements</a>
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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
|
||||
* would suffice. Use the {@link #zip()} method instead to add
|
||||
* 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.
|
||||
* @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.
|
||||
*/
|
||||
@Deprecated
|
||||
|
@ -750,7 +750,7 @@ public interface JwtParserBuilder extends Builder<JwtParser> {
|
|||
*
|
||||
* @param base64UrlDecoder the decoder to use when Base64Url-decoding
|
||||
* @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.
|
||||
*/
|
||||
@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.
|
||||
* @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.
|
||||
*/
|
||||
@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.
|
||||
* @return the builder for method chaining.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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.
|
||||
*
|
||||
* @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> {
|
||||
|
||||
|
|
|
@ -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>
|
||||
*
|
||||
* @see #get()
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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>
|
||||
*
|
||||
* @see #get()
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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>
|
||||
*
|
||||
* @see #get()
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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>
|
||||
*
|
||||
* @see #get()
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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.
|
||||
*
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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
|
||||
* which builder properties are set.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
public static HeaderBuilder header() {
|
||||
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>.
|
||||
* 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.
|
||||
* @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.
|
||||
*/
|
||||
@Deprecated
|
||||
|
|
|
@ -26,7 +26,7 @@ import java.security.Key;
|
|||
* {@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
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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).
|
||||
*
|
||||
* @param <T> the type of object to locate
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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 message the message explaining why the exception is 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
|
||||
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 cause cause
|
||||
* @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
|
||||
public PrematureJwtException(Header header, Claims claims, String message, Throwable cause) {
|
||||
|
|
|
@ -26,7 +26,7 @@ import java.util.Set;
|
|||
*
|
||||
* @see JwsHeader
|
||||
* @see JweHeader
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
public interface ProtectedHeader extends Header, X509Accessor {
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ import java.net.URI;
|
|||
* Mutation (modifications) to a {@link ProtectedHeader Header} instance.
|
||||
*
|
||||
* @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> {
|
||||
|
||||
|
@ -90,25 +90,25 @@ public interface ProtectedHeaderMutator<T extends ProtectedHeaderMutator<T>> ext
|
|||
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.
|
||||
* @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/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
|
||||
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.
|
||||
*
|
||||
* @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.
|
||||
* @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
|
||||
T setAlgorithm(String alg);
|
||||
|
|
|
@ -31,7 +31,7 @@ import io.jsonwebtoken.security.DigestSupplier;
|
|||
*
|
||||
* @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.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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.
|
||||
*
|
||||
* @since 0.1
|
||||
* @deprecated since JJWT_RELEASE_VERSION; use {@link Jwts.SIG} instead.
|
||||
* @deprecated since 0.12.0; use {@link Jwts.SIG} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public enum SignatureAlgorithm {
|
||||
|
|
|
@ -46,7 +46,7 @@ import java.security.Key;
|
|||
*
|
||||
* @see io.jsonwebtoken.JwtParserBuilder#keyLocator(Locator)
|
||||
* @since 0.4
|
||||
* @deprecated since JJWT_RELEASE_VERSION. Implement {@link Locator} instead.
|
||||
* @deprecated since 0.12.0. Implement {@link Locator} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public interface SigningKeyResolver {
|
||||
|
|
|
@ -23,7 +23,7 @@ import java.security.Key;
|
|||
/**
|
||||
* <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),
|
||||
* 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
|
||||
|
@ -49,7 +49,7 @@ import java.security.Key;
|
|||
* @see io.jsonwebtoken.JwtParserBuilder#keyLocator(Locator)
|
||||
* @see LocatorAdapter
|
||||
* @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)}
|
||||
*/
|
||||
@SuppressWarnings("DeprecatedIsStillUsed")
|
||||
|
|
|
@ -23,7 +23,7 @@ import io.jsonwebtoken.lang.Assert;
|
|||
* 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.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
public class SupportedJwtVisitor<T> implements JwtVisitor<T> {
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import java.nio.charset.StandardCharsets;
|
|||
* {@link #doDeserialize(Reader)}.
|
||||
*
|
||||
* @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> {
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ import java.io.OutputStream;
|
|||
* * {@link #doSerialize(Object, OutputStream)}.
|
||||
*
|
||||
* @param <T> the type of object to serialize
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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
|
||||
* @throws Exception if there is a problem converting the object to a byte stream or writing the
|
||||
* 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;
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ import java.io.OutputStream;
|
|||
* @see Jwts.ZIP#DEF
|
||||
* @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>
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
public interface CompressionAlgorithm extends Identifiable {
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ public interface Deserializer<T> {
|
|||
* @param bytes the formatted data byte array to convert
|
||||
* @return the reconstituted Java 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
|
||||
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
|
||||
* @return the deserialized 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;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ import java.io.Reader;
|
|||
* A Parser converts a character stream into a Java object.
|
||||
*
|
||||
* @param <T> the instance type created after parsing
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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 <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>> {
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ public interface Serializer<T> {
|
|||
* @param t the object to serialize
|
||||
* @return the serialized byte array representing the specified object.
|
||||
* @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
|
||||
byte[] serialize(T t) throws SerializationException;
|
||||
|
@ -45,7 +45,7 @@ public interface Serializer<T> {
|
|||
* @param out the stream to write to
|
||||
* @throws SerializationException if there is a problem converting the object to a byte stream or writing the
|
||||
* bytes to the {@code out}put stream.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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
|
||||
* @return the byte array if the assertion passes
|
||||
* @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) {
|
||||
if (Objects.isEmpty(array)) {
|
||||
|
@ -246,7 +246,7 @@ public final class Assert {
|
|||
* @param msg the exception message to use if the assertion fails
|
||||
* @return the character array if the assertion passes
|
||||
* @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) {
|
||||
if (Objects.isEmpty(chars)) {
|
||||
|
@ -454,7 +454,7 @@ public final class Assert {
|
|||
* @param requirement the requirement that {@code value} must be greater than
|
||||
* @param msg the message to use for the {@code IllegalArgumentException} if thrown.
|
||||
* @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) {
|
||||
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 msg the message to use for the {@code IllegalArgumentException} if thrown.
|
||||
* @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) {
|
||||
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 msg the message to use for the {@code IllegalArgumentException} if thrown.
|
||||
* @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) {
|
||||
if (compareTo(value, requirement) > 0) {
|
||||
|
@ -546,7 +546,7 @@ public final class Assert {
|
|||
* @param <T> value type
|
||||
* @return the non-null value
|
||||
* @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 {
|
||||
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>.
|
||||
*
|
||||
* @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> {
|
||||
|
||||
|
|
|
@ -130,7 +130,7 @@ public final class Classes {
|
|||
* @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
|
||||
* of the three mentioned ClassLoaders.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
private static URL getResource(String 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 <T> the type of object expected to be returned from the method
|
||||
* @return the result returned by the invoked method.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
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 <M> the mutator subtype, for method chaining
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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 <T> collection element type
|
||||
* @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) {
|
||||
if (c instanceof Set) {
|
||||
|
@ -125,7 +125,7 @@ public final class Collections {
|
|||
* @param <K> map key type
|
||||
* @param <V> map value type
|
||||
* @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) {
|
||||
return m != null ? java.util.Collections.unmodifiableMap(m) : null;
|
||||
|
@ -163,7 +163,7 @@ public final class Collections {
|
|||
* @param <C> type of collection
|
||||
* @param <T> type of elements in the collection
|
||||
* @return an immutable wrapper for {@code l}.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
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 <T> type of elements in the set
|
||||
* @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) {
|
||||
return s == null ? Collections.<T>emptySet() : s;
|
||||
|
@ -196,7 +196,7 @@ public final class Collections {
|
|||
* @param c the collection to check for null
|
||||
* @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.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
public static <T> Collection<T> nullSafe(Collection<T> c) {
|
||||
return c == null ? Collections.<T>emptyList() : c;
|
||||
|
|
|
@ -20,7 +20,7 @@ package io.jsonwebtoken.lang;
|
|||
* to the source/original builder.
|
||||
*
|
||||
* @param <T> the type of joined object to return.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
public interface Conjunctor<T> {
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ import java.util.Map;
|
|||
* @param <K> map key type
|
||||
* @param <V> map value type
|
||||
* @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>> {
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ package io.jsonwebtoken.lang;
|
|||
*
|
||||
* @param <E> the type of elements in the collection
|
||||
* @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> {
|
||||
}
|
||||
|
|
|
@ -102,7 +102,7 @@ public final class Objects {
|
|||
*
|
||||
* @param v object to check
|
||||
* @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) {
|
||||
return v == null ||
|
||||
|
@ -1015,7 +1015,7 @@ public final class Objects {
|
|||
* {@link Flushable#flush()} on each one, ignoring any potential {@link IOException}s.
|
||||
*
|
||||
* @param flushables the flushables to flush.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
public static void nullSafeFlush(Flushable... flushables) {
|
||||
if (flushables == null) return;
|
||||
|
|
|
@ -33,7 +33,7 @@ import java.util.Map;
|
|||
*
|
||||
* @param <K> key type
|
||||
* @param <V> value type
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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.
|
||||
*
|
||||
* @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
|
||||
public final class RuntimeEnvironment {
|
||||
|
@ -37,7 +37,7 @@ public final class RuntimeEnvironment {
|
|||
/**
|
||||
* {@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
|
||||
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
|
||||
* 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
|
||||
public static void enableBouncyCastleIfPossible() {
|
||||
|
|
|
@ -240,7 +240,7 @@ public final class Strings {
|
|||
*
|
||||
* @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}.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
public static byte[] utf8(CharSequence s) {
|
||||
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.
|
||||
* @return {@code new String(utf8Bytes, StandardCharsets.UTF_8)}.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
public static String utf8(byte[] utf8Bytes) {
|
||||
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.
|
||||
* @return {@code new String(asciiBytes, StandardCharsets.US_ASCII)}.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
public static String ascii(byte[] asciiBytes) {
|
||||
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
|
||||
* @return the string builder argument for method chaining.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
public static StringBuilder nespace(StringBuilder sb) {
|
||||
if (sb == null) {
|
||||
|
|
|
@ -24,7 +24,7 @@ package io.jsonwebtoken.lang;
|
|||
* JDK 7 environments.</p>
|
||||
*
|
||||
* @param <T> the type of object returned by this supplier
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
public interface Supplier<T> {
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ import java.io.OutputStream;
|
|||
* @see KeyLengthSupplier
|
||||
* @see KeyBuilderSupplier
|
||||
* @see KeyBuilder
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
public interface AeadAlgorithm extends Identifiable, KeyLengthSupplier, KeyBuilderSupplier<SecretKey, SecretKeyBuilder> {
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ import java.io.InputStream;
|
|||
*
|
||||
* @see SecureRequest
|
||||
* @see AssociatedDataSupplier
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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}.
|
||||
* 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 {
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ import java.io.InputStream;
|
|||
* <a href="https://en.wikipedia.org/wiki/Authenticated_encryption">AEAD encryption or decryption</a>.
|
||||
*
|
||||
* @see #getAssociatedData()
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
public interface AssociatedDataSupplier {
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ import java.security.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.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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 <J> the type of asymmetric JWK created
|
||||
* @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>>
|
||||
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>
|
||||
*
|
||||
* @see Jwks.CRV
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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
|
||||
* 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 {
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ import java.security.Key;
|
|||
* 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.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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.
|
||||
* @see Jwks.HASH
|
||||
* @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 {
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ package io.jsonwebtoken.security;
|
|||
* A {@code DigestSupplier} provides access to the result of a cryptographic digest algorithm, such as a
|
||||
* Message Digest, MAC, Signature, or Authentication Tag.
|
||||
*
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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 <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>> {
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ import java.security.interfaces.ECPublicKey;
|
|||
* jwk.get("y");
|
||||
* // ... etc ...</pre></blockquote>
|
||||
*
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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.
|
||||
*
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
public interface EcPrivateJwkBuilder extends PrivateJwkBuilder<ECPrivateKey, ECPublicKey, EcPublicJwk, EcPrivateJwk, EcPrivateJwkBuilder> {
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ import java.security.interfaces.ECPublicKey;
|
|||
* jwk.get("y");
|
||||
* // ... etc ...</pre></blockquote>
|
||||
*
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
public interface EcPublicJwk extends PublicJwk<ECPublicKey> {
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ import java.security.interfaces.ECPublicKey;
|
|||
/**
|
||||
* 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> {
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ import java.io.InputStream;
|
|||
* Algorithms</a> are available via {@link Jwks.HASH}.</p>
|
||||
*
|
||||
* @see Jwks.HASH
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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 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) {
|
||||
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
|
||||
* encryption attempt.
|
||||
*
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
public interface IvSupplier {
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ import java.util.Set;
|
|||
* JWK internal serialization parameters.</p>
|
||||
*
|
||||
* @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> {
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ import java.security.Key;
|
|||
* @see EcPrivateJwkBuilder
|
||||
* @see OctetPublicJwkBuilder
|
||||
* @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>>
|
||||
extends MapMutator<String, Object, T>, SecurityBuilder<J, T>, KeyOperationPolicied<T> {
|
||||
|
|
|
@ -29,7 +29,7 @@ import io.jsonwebtoken.io.ParserBuilder;
|
|||
* .build()
|
||||
* .parse(jwkString);</pre></blockquote>
|
||||
*
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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 UnsupportedOperationException}.</p>
|
||||
*
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
public interface JwkSet extends Map<String, Object>, Iterable<Jwk<?>> {
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ import java.util.Collection;
|
|||
*
|
||||
* @see #operationPolicy(KeyOperationPolicy)
|
||||
* @see #provider(Provider)
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
public interface JwkSetBuilder extends MapMutator<String, Object, JwkSetBuilder>,
|
||||
SecurityBuilder<JwkSet, JwkSetBuilder>, KeyOperationPolicied<JwkSetBuilder> {
|
||||
|
|
|
@ -30,7 +30,7 @@ import io.jsonwebtoken.io.ParserBuilder;
|
|||
* .build()
|
||||
* .parse(jwkSetString);</pre></blockquote>
|
||||
*
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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 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 {
|
||||
|
||||
|
|
|
@ -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>
|
||||
*
|
||||
* @see #builder()
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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>
|
||||
*
|
||||
* @see #get()
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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>
|
||||
*
|
||||
* @see #get()
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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>
|
||||
*
|
||||
* @see #get()
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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
|
||||
* @see Jwts.KEY
|
||||
* @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")
|
||||
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 <B> the type of the builder, for subtype method chaining
|
||||
* @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> {
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ import java.security.Key;
|
|||
* @param <B> type of builder to create each time {@link #key()} is called.
|
||||
* @see #key()
|
||||
* @see KeyBuilder
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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.
|
||||
*
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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://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 {
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ import io.jsonwebtoken.lang.Builder;
|
|||
* @see Jwks.OP#builder()
|
||||
* @see Jwks.OP#policy()
|
||||
* @see JwkBuilder#operationPolicy(KeyOperationPolicy)
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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.
|
||||
*
|
||||
* @see JwkBuilder#operationPolicy(KeyOperationPolicy)
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
public interface KeyOperationPolicy {
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import java.util.Collection;
|
|||
* @see Jwks.OP#policy()
|
||||
* @see JwkBuilder#operationPolicy(KeyOperationPolicy)
|
||||
* @see Jwks.OP#builder()
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
public interface KeyOperationPolicyBuilder extends CollectionMutator<KeyOperation, KeyOperationPolicyBuilder>,
|
||||
Builder<KeyOperationPolicy> {
|
||||
|
|
|
@ -24,7 +24,7 @@ import java.security.PublicKey;
|
|||
*
|
||||
* @param <A> The type of {@link PublicKey} 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> {
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ import java.security.KeyPair;
|
|||
* ensuring the resulting {@link KeyPair}s are compatible with their associated cryptographic algorithm.</p>
|
||||
*
|
||||
* @see KeyPairBuilderSupplier
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
public interface KeyPairBuilder extends SecurityBuilder<KeyPair, KeyPairBuilder> {
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ import java.security.KeyPair;
|
|||
*
|
||||
* @see #keyPair()
|
||||
* @see KeyPairBuilder
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
public interface KeyPairBuilderSupplier {
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ import io.jsonwebtoken.JweHeader;
|
|||
*
|
||||
* @param <T> the type of object relevant during key algorithm cryptographic operations.
|
||||
* @see DecryptionKeyRequest
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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
|
||||
* the JWE.</p>
|
||||
*
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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.
|
||||
*
|
||||
* @param <K> the type of key provided by this supplier.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
public interface KeySupplier<K extends Key> {
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ public final class Keys {
|
|||
/**
|
||||
* <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>
|
||||
*
|
||||
* <pre><code>
|
||||
|
@ -132,7 +132,7 @@ public final class Keys {
|
|||
* @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},
|
||||
* {@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.
|
||||
*/
|
||||
@SuppressWarnings("DeprecatedIsStillUsed")
|
||||
|
@ -150,7 +150,7 @@ public final class Keys {
|
|||
/**
|
||||
* <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>
|
||||
*
|
||||
* <blockquote><pre>
|
||||
|
@ -236,7 +236,7 @@ public final class Keys {
|
|||
* @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.
|
||||
* @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 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.
|
||||
* @return a new {@link Password} instance that wraps a new clone of the specified {@code password} character array.
|
||||
* @see Password#toCharArray()
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
public static Password password(char[] password) {
|
||||
return invokeStatic("password", FOR_PASSWORD_ARG_TYPES, new Object[]{password});
|
||||
|
@ -296,7 +296,7 @@ public final class Keys {
|
|||
* {@link Provider}
|
||||
* @return a new {@code SecretKeyBuilder} that produces the specified key, potentially associated with any
|
||||
* specified provider.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
public static SecretKeyBuilder builder(SecretKey key) {
|
||||
Assert.notNull(key, "SecretKey cannot be null.");
|
||||
|
@ -323,7 +323,7 @@ public final class Keys {
|
|||
* {@link Provider} or {@link PublicKey}.
|
||||
* @return a new {@code PrivateKeyBuilder} that produces the specified private key, potentially associated with any
|
||||
* specified provider or {@code PublicKey}
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
public static PrivateKeyBuilder builder(PrivateKey key) {
|
||||
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>
|
||||
*
|
||||
* @see io.jsonwebtoken.Jwts.SIG Jwts.SIG
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
public interface MacAlgorithm extends SecureDigestAlgorithm<SecretKey, SecretKey>,
|
||||
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
|
||||
* formatted and cannot be used as expected.
|
||||
*
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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
|
||||
* formatted and cannot be used as expected.
|
||||
*
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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.
|
||||
*
|
||||
* @param <T> The type of payload in the message.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
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 <L> The type of Edwards-curve {@link PublicKey} represented by the JWK's corresponding
|
||||
* {@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>> {
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ import java.security.PublicKey;
|
|||
*
|
||||
* @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.
|
||||
* @since JJWT_RELEASE_VERSION
|
||||
* @since 0.12.0
|
||||
*/
|
||||
public interface OctetPrivateJwkBuilder<K extends PrivateKey, L extends PublicKey> extends
|
||||
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