Skip to content

Commit 4379a6a

Browse files
committed
Migrated all uses of Jwts.ENC to Jwe.alg
1 parent 2fd9abe commit 4379a6a

37 files changed

+247
-142
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ All JWA-defined encryption algorithms and key management algorithms are fully im
226226
available immediately. For example:
227227

228228
```java
229-
AeadAlgorithm enc = Jwts.ENC.A256GCM;
229+
AeadAlgorithm enc = Jwe.alg.A256GCM;
230230
SecretKey key = enc.key().build();
231231
String compact = Jwts.builder().setSubject("Joe").encryptWith(key, enc).compact();
232232

README.adoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2225,7 +2225,7 @@ The JWT specification defines 6 standard Authenticated Encryption algorithms use
22252225
| AES GCM using 256-bit key
22262226
|===
22272227

2228-
These are all represented as constants in the `io.jsonwebtoken.Jwts.ENC` registry singleton as
2228+
These are all represented as constants in the `io.jsonwebtoken.Jwe.alg` registry singleton as
22292229
implementations of the `io.jsonwebtoken.security.AeadAlgorithm` interface.
22302230

22312231
As shown in the table above, each algorithm requires a key of sufficient length. The JWT specification
@@ -3891,7 +3891,7 @@ Example:
38913891
----
38923892
// Create a test key suitable for the desired payload encryption algorithm:
38933893
// (A*GCM algorithms are recommended, but require JDK >= 8 or BouncyCastle)
3894-
AeadAlgorithm enc = Jwts.ENC.A256GCM; //or A128GCM, A192GCM, A256CBC-HS512, etc...
3894+
AeadAlgorithm enc = Jwe.alg.A256GCM; //or A128GCM, A192GCM, A256CBC-HS512, etc...
38953895
SecretKey key = enc.key().build();
38963896
38973897
String message = "Live long and prosper.";
@@ -3927,7 +3927,7 @@ KeyPair pair = Jws.alg.RS512.keyPair().build();
39273927
// Choose the key algorithm used encrypt the payload key:
39283928
KeyAlgorithm<PublicKey, PrivateKey> alg = Jwts.KEY.RSA_OAEP_256; //or RSA_OAEP or RSA1_5
39293929
// Choose the Encryption Algorithm to encrypt the payload:
3930-
AeadAlgorithm enc = Jwts.ENC.A256GCM; //or A192GCM, A128GCM, A256CBC-HS512, etc...
3930+
AeadAlgorithm enc = Jwe.alg.A256GCM; //or A192GCM, A128GCM, A256CBC-HS512, etc...
39313931
39323932
// Bob creates the compact JWE with Alice's RSA public key so only she may read it:
39333933
String jwe = Jwts.builder().audience().add("Alice").and()
@@ -3964,7 +3964,7 @@ SecretKeyAlgorithm alg = Jwts.KEY.A256GCMKW; //or A192GCMKW, A128GCMKW, A256KW,
39643964
SecretKey key = alg.key().build();
39653965
39663966
// Chooose the Encryption Algorithm used to encrypt the payload:
3967-
AeadAlgorithm enc = Jwts.ENC.A256GCM; //or A192GCM, A128GCM, A256CBC-HS512, etc...
3967+
AeadAlgorithm enc = Jwe.alg.A256GCM; //or A192GCM, A128GCM, A256CBC-HS512, etc...
39683968
39693969
// Create the compact JWE:
39703970
String jwe = Jwts.builder().issuer("me").encryptWith(key, alg, enc).compact();
@@ -3999,7 +3999,7 @@ KeyPair pair = Jws.alg.ES512.keyPair().build();
39993999
// Choose the key algorithm used encrypt the payload key:
40004000
KeyAlgorithm<PublicKey, PrivateKey> alg = Jwts.KEY.ECDH_ES_A256KW; //ECDH_ES_A192KW, etc...
40014001
// Choose the Encryption Algorithm to encrypt the payload:
4002-
AeadAlgorithm enc = Jwts.ENC.A256GCM; //or A192GCM, A128GCM, A256CBC-HS512, etc...
4002+
AeadAlgorithm enc = Jwe.alg.A256GCM; //or A192GCM, A128GCM, A256CBC-HS512, etc...
40034003
40044004
// Bob creates the compact JWE with Alice's EC public key so only she may read it:
40054005
String jwe = Jwts.builder().audience().add("Alice").and()
@@ -4046,7 +4046,7 @@ KeyAlgorithm<Password, Password> alg = Jwts.KEY.PBES2_HS512_A256KW; //or PBES2_H
40464046
//int pbkdf2Iterations = 120000; //for HS512. Needs to be much higher for smaller hash algs.
40474047
40484048
// Choose the Encryption Algorithm used to encrypt the payload:
4049-
AeadAlgorithm enc = Jwts.ENC.A256GCM; //or A192GCM, A128GCM, A256CBC-HS512, etc...
4049+
AeadAlgorithm enc = Jwe.alg.A256GCM; //or A192GCM, A128GCM, A256CBC-HS512, etc...
40504050
40514051
// Create the compact JWE:
40524052
String jwe = Jwts.builder().issuer("me")

api/src/main/java/io/jsonwebtoken/Jwe.java

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
*/
1616
package io.jsonwebtoken;
1717

18+
import io.jsonwebtoken.lang.Classes;
19+
import io.jsonwebtoken.lang.Registry;
20+
import io.jsonwebtoken.security.AeadAlgorithm;
21+
1822
/**
1923
* An encrypted JWT, called a &quot;JWE&quot;, per the
2024
* <a href="https://www.rfc-editor.org/rfc/rfc7516.html">JWE (RFC 7516) Specification</a>.
@@ -24,6 +28,86 @@
2428
*/
2529
public interface Jwe<B> extends ProtectedJwt<JweHeader, B> {
2630

31+
/**
32+
* Constants for all standard JWA
33+
* <a href="https://www.rfc-editor.org/rfc/rfc7518.html#section-5">Cryptographic Algorithms for Content
34+
* Encryption</a> defined in the <a href="https://www.rfc-editor.org/rfc/rfc7518.html#section-7.1">JSON
35+
* Web Signature and Encryption Algorithms Registry</a>. Each standard algorithm is available as a
36+
* ({@code public static final}) constant for direct type-safe reference in application code. For example:
37+
* <blockquote><pre>
38+
* Jwts.builder()
39+
* // ... etc ...
40+
* .encryptWith(aKey, <b>Jwe.alg.A256GCM</b>) // or A128GCM, A192GCM, etc...
41+
* .build();</pre></blockquote>
42+
* <p>They are also available together as a {@link Registry} instance via the {@link #registry()} method.</p>
43+
*
44+
* @see #registry()
45+
* @since JJWT_RELEASE_VERSION
46+
*/
47+
final class alg {
48+
49+
private static final String IMPL_CLASSNAME = "io.jsonwebtoken.impl.security.StandardEncryptionAlgorithms";
50+
private static final Registry<String, AeadAlgorithm> REGISTRY = Classes.newInstance(IMPL_CLASSNAME);
51+
52+
/**
53+
* Returns all standard JWA <a href="https://www.rfc-editor.org/rfc/rfc7518.html#section-5">Cryptographic
54+
* Algorithms for Content Encryption</a> defined in the
55+
* <a href="https://www.rfc-editor.org/rfc/rfc7518.html#section-7.1">JSON Web Signature and Encryption
56+
* Algorithms Registry</a>.
57+
*
58+
* @return all standard JWA content encryption algorithms.
59+
*/
60+
public static Registry<String, AeadAlgorithm> registry() {
61+
return REGISTRY;
62+
}
63+
64+
// prevent instantiation
65+
private alg() {
66+
}
67+
68+
/**
69+
* {@code AES_128_CBC_HMAC_SHA_256} authenticated encryption algorithm as defined by
70+
* <a href="https://tools.ietf.org/html/rfc7518#section-5.2.3">RFC 7518, Section 5.2.3</a>. This algorithm
71+
* requires a 256-bit (32 byte) key.
72+
*/
73+
public static final AeadAlgorithm A128CBC_HS256 = registry().forKey("A128CBC-HS256");
74+
75+
/**
76+
* {@code AES_192_CBC_HMAC_SHA_384} authenticated encryption algorithm, as defined by
77+
* <a href="https://tools.ietf.org/html/rfc7518#section-5.2.4">RFC 7518, Section 5.2.4</a>. This algorithm
78+
* requires a 384-bit (48 byte) key.
79+
*/
80+
public static final AeadAlgorithm A192CBC_HS384 = registry().forKey("A192CBC-HS384");
81+
82+
/**
83+
* {@code AES_256_CBC_HMAC_SHA_512} authenticated encryption algorithm, as defined by
84+
* <a href="https://tools.ietf.org/html/rfc7518#section-5.2.5">RFC 7518, Section 5.2.5</a>. This algorithm
85+
* requires a 512-bit (64 byte) key.
86+
*/
87+
public static final AeadAlgorithm A256CBC_HS512 = registry().forKey("A256CBC-HS512");
88+
89+
/**
90+
* &quot;AES GCM using 128-bit key&quot; as defined by
91+
* <a href="https://tools.ietf.org/html/rfc7518#section-5.3">RFC 7518, Section 5.3</a>. This
92+
* algorithm requires a 128-bit (16 byte) key.
93+
*/
94+
public static final AeadAlgorithm A128GCM = registry().forKey("A128GCM");
95+
96+
/**
97+
* &quot;AES GCM using 192-bit key&quot; as defined by
98+
* <a href="https://tools.ietf.org/html/rfc7518#section-5.3">RFC 7518, Section 5.3</a>. This
99+
* algorithm requires a 192-bit (24 byte) key.
100+
*/
101+
public static final AeadAlgorithm A192GCM = registry().forKey("A192GCM");
102+
103+
/**
104+
* &quot;AES GCM using 256-bit key&quot; as defined by
105+
* <a href="https://tools.ietf.org/html/rfc7518#section-5.3">RFC 7518, Section 5.3</a>. This
106+
* algorithm requires a 256-bit (32 byte) key.
107+
*/
108+
public static final AeadAlgorithm A256GCM = registry().forKey("A256GCM");
109+
}
110+
27111
/**
28112
* Visitor implementation that ensures the visited JWT is a JSON Web Encryption ('JWE') message with an
29113
* authenticated and decrypted {@code byte[]} array payload, and rejects all others with an

api/src/main/java/io/jsonwebtoken/JwtBuilder.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -885,9 +885,9 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
885885
*
886886
* @param key the symmetric encryption key to use with the {@code enc} algorithm.
887887
* @param enc the {@link AeadAlgorithm} algorithm used to encrypt the JWE, usually one of the JWA-standard
888-
* algorithms accessible via {@link Jwts.ENC}.
888+
* algorithms accessible via {@link Jwe.alg}.
889889
* @return the JWE builder for method chaining.
890-
* @see Jwts.ENC
890+
* @see Jwe.alg
891891
*/
892892
JwtBuilder encryptWith(SecretKey key, AeadAlgorithm enc);
893893

@@ -908,7 +908,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
908908
* </ol>
909909
*
910910
* <p>Most application developers will reference one of the JWA
911-
* {@link Jwts.KEY standard key algorithms} and {@link Jwts.ENC standard encryption algorithms}
911+
* {@link Jwts.KEY standard key algorithms} and {@link Jwe.alg standard encryption algorithms}
912912
* when invoking this method, but custom implementations are also supported.</p>
913913
*
914914
* @param <K> the type of key that must be used with the specified {@code keyAlg} instance.
@@ -917,7 +917,7 @@ public interface JwtBuilder extends ClaimsMutator<JwtBuilder> {
917917
* {@code enc} algorithm
918918
* @param enc the {@link AeadAlgorithm} algorithm used to encrypt the JWE
919919
* @return the JWE builder for method chaining.
920-
* @see Jwts.ENC
920+
* @see Jwe.alg
921921
* @see Jwts.KEY
922922
*/
923923
<K extends Key> JwtBuilder encryptWith(K key, KeyAlgorithm<? super K, ?> keyAlg, AeadAlgorithm enc);

api/src/main/java/io/jsonwebtoken/JwtParserBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ public interface JwtParserBuilder extends Builder<JwtParser> {
574574
*
575575
* <p><b>Standard Algorithms and Overrides</b></p>
576576
*
577-
* <p>All JWA-standard AEAD encryption algorithms in the {@link Jwts.ENC} registry are supported by default and
577+
* <p>All JWA-standard AEAD encryption algorithms in the {@link Jwe.alg} registry are supported by default and
578578
* do not need to be added. The collection may be useful however for removing some algorithms (for example,
579579
* any algorithms not used by the application, or those not compatible with application security requirements),
580580
* or for adding custom implementations.</p>
@@ -595,7 +595,7 @@ public interface JwtParserBuilder extends Builder<JwtParser> {
595595
*
596596
* @return the {@link NestedCollection} to use to configure the AEAD encryption algorithms available when parsing.
597597
* @see JwtBuilder#encryptWith(Key, KeyAlgorithm, AeadAlgorithm)
598-
* @see Jwts.ENC
598+
* @see Jwe.alg
599599
* @see <a href="https://www.rfc-editor.org/rfc/rfc7516.html#section-4.1.2">&quot;enc&quot; (Encryption Algorithm) Header Parameter</a>
600600
* @see <a href="https://www.rfc-editor.org/rfc/rfc7518.html#section-7.1.1">Encryption Algorithm Name (id) requirements</a>
601601
* @since 0.12.0

api/src/main/java/io/jsonwebtoken/Jwts.java

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,28 +70,29 @@ static <T> T get(Registry<String, ?> registry, String id) {
7070
* <blockquote><pre>
7171
* Jwts.builder()
7272
* // ... etc ...
73-
* .encryptWith(aKey, <b>Jwts.ENC.A256GCM</b>) // or A128GCM, A192GCM, etc...
73+
* .encryptWith(aKey, <b>Jwe.alg.A256GCM</b>) // or A128GCM, A192GCM, etc...
7474
* .build();</pre></blockquote>
75-
* <p>They are also available together as a {@link Registry} instance via the {@link #get()} method.</p>
75+
* <p>They are also available together as a {@link Registry} instance via {@link Jwe.alg#registry()}.</p>
7676
*
77-
* @see #get()
77+
* @see Jwe.alg#registry()
7878
* @since 0.12.0
79+
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link Jwe.alg}.
7980
*/
81+
@Deprecated
8082
public static final class ENC {
8183

82-
private static final String IMPL_CLASSNAME = "io.jsonwebtoken.impl.security.StandardEncryptionAlgorithms";
83-
private static final Registry<String, AeadAlgorithm> REGISTRY = Classes.newInstance(IMPL_CLASSNAME);
84-
8584
/**
8685
* Returns all standard JWA <a href="https://www.rfc-editor.org/rfc/rfc7518.html#section-5">Cryptographic
8786
* Algorithms for Content Encryption</a> defined in the
8887
* <a href="https://www.rfc-editor.org/rfc/rfc7518.html#section-7.1">JSON Web Signature and Encryption
8988
* Algorithms Registry</a>.
9089
*
9190
* @return all standard JWA content encryption algorithms.
91+
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link Jwe.alg#registry()}.
9292
*/
93+
@Deprecated
9394
public static Registry<String, AeadAlgorithm> get() {
94-
return REGISTRY;
95+
return Jwe.alg.registry();
9596
}
9697

9798
// prevent instantiation
@@ -102,43 +103,56 @@ private ENC() {
102103
* {@code AES_128_CBC_HMAC_SHA_256} authenticated encryption algorithm as defined by
103104
* <a href="https://tools.ietf.org/html/rfc7518#section-5.2.3">RFC 7518, Section 5.2.3</a>. This algorithm
104105
* requires a 256-bit (32 byte) key.
106+
*
107+
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link Jwe.alg#A128CBC_HS256}.
105108
*/
106-
public static final AeadAlgorithm A128CBC_HS256 = get().forKey("A128CBC-HS256");
109+
@Deprecated
110+
public static final AeadAlgorithm A128CBC_HS256 = Jwe.alg.A128CBC_HS256;
107111

108112
/**
109113
* {@code AES_192_CBC_HMAC_SHA_384} authenticated encryption algorithm, as defined by
110114
* <a href="https://tools.ietf.org/html/rfc7518#section-5.2.4">RFC 7518, Section 5.2.4</a>. This algorithm
111115
* requires a 384-bit (48 byte) key.
116+
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link Jwe.alg#A192CBC_HS384}.
112117
*/
113-
public static final AeadAlgorithm A192CBC_HS384 = get().forKey("A192CBC-HS384");
118+
@Deprecated
119+
public static final AeadAlgorithm A192CBC_HS384 = Jwe.alg.A192CBC_HS384;
114120

115121
/**
116122
* {@code AES_256_CBC_HMAC_SHA_512} authenticated encryption algorithm, as defined by
117123
* <a href="https://tools.ietf.org/html/rfc7518#section-5.2.5">RFC 7518, Section 5.2.5</a>. This algorithm
118124
* requires a 512-bit (64 byte) key.
125+
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link Jwe.alg#A256CBC_HS512}.
119126
*/
120-
public static final AeadAlgorithm A256CBC_HS512 = get().forKey("A256CBC-HS512");
127+
@Deprecated
128+
public static final AeadAlgorithm A256CBC_HS512 = Jwe.alg.A256CBC_HS512;
121129

122130
/**
123131
* &quot;AES GCM using 128-bit key&quot; as defined by
124132
* <a href="https://tools.ietf.org/html/rfc7518#section-5.3">RFC 7518, Section 5.3</a>. This
125133
* algorithm requires a 128-bit (16 byte) key.
134+
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link Jwe.alg#A128GCM}.
126135
*/
127-
public static final AeadAlgorithm A128GCM = get().forKey("A128GCM");
136+
@Deprecated
137+
public static final AeadAlgorithm A128GCM = Jwe.alg.A128GCM;
128138

129139
/**
130140
* &quot;AES GCM using 192-bit key&quot; as defined by
131141
* <a href="https://tools.ietf.org/html/rfc7518#section-5.3">RFC 7518, Section 5.3</a>. This
132142
* algorithm requires a 192-bit (24 byte) key.
143+
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link Jwe.alg#A192GCM}.
133144
*/
134-
public static final AeadAlgorithm A192GCM = get().forKey("A192GCM");
145+
@Deprecated
146+
public static final AeadAlgorithm A192GCM = Jwe.alg.A192GCM;
135147

136148
/**
137149
* &quot;AES GCM using 256-bit key&quot; as defined by
138150
* <a href="https://tools.ietf.org/html/rfc7518#section-5.3">RFC 7518, Section 5.3</a>. This
139151
* algorithm requires a 256-bit (32 byte) key.
152+
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link Jwe.alg#A256GCM}.
140153
*/
141-
public static final AeadAlgorithm A256GCM = get().forKey("A256GCM");
154+
@Deprecated
155+
public static final AeadAlgorithm A256GCM = Jwe.alg.A256GCM;
142156
}
143157

144158
/**
@@ -296,6 +310,7 @@ private SIG() {
296310
* {@code ECDSA using P-256 and SHA-256} signature algorithm as defined by
297311
* <a href="https://www.rfc-editor.org/rfc/rfc7518.html#section-3.4">RFC 7518, Section 3.4</a>. This algorithm
298312
* requires a 256-bit key.
313+
*
299314
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link Jws.alg#ES256}
300315
*/
301316
@Deprecated
@@ -305,6 +320,7 @@ private SIG() {
305320
* {@code ECDSA using P-384 and SHA-384} signature algorithm as defined by
306321
* <a href="https://www.rfc-editor.org/rfc/rfc7518.html#section-3.4">RFC 7518, Section 3.4</a>. This algorithm
307322
* requires a 384-bit key.
323+
*
308324
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link Jws.alg#ES384}
309325
*/
310326
@Deprecated
@@ -314,6 +330,7 @@ private SIG() {
314330
* {@code ECDSA using P-521 and SHA-512} signature algorithm as defined by
315331
* <a href="https://www.rfc-editor.org/rfc/rfc7518.html#section-3.4">RFC 7518, Section 3.4</a>. This algorithm
316332
* requires a 521-bit key.
333+
*
317334
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link Jws.alg#ES512}
318335
*/
319336
@Deprecated
@@ -337,6 +354,7 @@ private SIG() {
337354
*
338355
* <p><b><sup>1</sup>This algorithm requires at least JDK 15 or a compatible JCA Provider (like BouncyCastle) in the runtime
339356
* classpath.</b></p>
357+
*
340358
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link Jws.alg#EdDSA}
341359
*/
342360
@Deprecated
@@ -350,7 +368,7 @@ private SIG() {
350368
* <blockquote><pre>
351369
* Jwts.builder()
352370
* // ... etc ...
353-
* .encryptWith(aKey, <b>Jwts.KEY.ECDH_ES_A256KW</b>, Jwts.ENC.A256GCM)
371+
* .encryptWith(aKey, <b>Jwts.KEY.ECDH_ES_A256KW</b>, Jwe.alg.A256GCM)
354372
* .build();</pre></blockquote>
355373
* <p>They are also available together as a {@link Registry} instance via the {@link #get()} method.</p>
356374
*

api/src/main/java/io/jsonwebtoken/security/AeadAlgorithm.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
package io.jsonwebtoken.security;
1717

1818
import io.jsonwebtoken.Identifiable;
19-
import io.jsonwebtoken.Jwts;
2019

2120
import javax.crypto.SecretKey;
2221
import java.io.OutputStream;
@@ -27,7 +26,7 @@
2726
* Per <a href="https://www.rfc-editor.org/rfc/rfc7516.html#section-4.1.2">JWE RFC 7516, Section 4.1.2</a>, all JWEs
2827
* <em>MUST</em> use an AEAD algorithm to encrypt or decrypt the JWE payload/content. Consequently, all
2928
* <a href="https://www.rfc-editor.org/rfc/rfc7518.html#section-5.1">JWA &quot;enc&quot; algorithms</a> are AEAD
30-
* algorithms, and they are accessible as concrete instances via {@link Jwts.ENC}.
29+
* algorithms, and they are accessible as concrete instances via {@link Jwe.alg}.
3130
*
3231
* <p><b>&quot;enc&quot; identifier</b></p>
3332
*
@@ -58,7 +57,7 @@
5857
* <p>The resulting {@code key} is guaranteed to have the correct algorithm parameters and strength/length necessary for
5958
* that exact {@code aeadAlgorithm} instance.</p>
6059
*
61-
* @see Jwts.ENC
60+
* @see Jwe.alg
6261
* @see Identifiable#getId()
6362
* @see KeyLengthSupplier
6463
* @see KeyBuilderSupplier

impl/src/main/java/io/jsonwebtoken/impl/DefaultJwtParserBuilder.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import io.jsonwebtoken.ClaimsBuilder;
1919
import io.jsonwebtoken.Clock;
2020
import io.jsonwebtoken.CompressionCodecResolver;
21+
import io.jsonwebtoken.Jwe;
2122
import io.jsonwebtoken.Jws;
2223
import io.jsonwebtoken.JwtParser;
2324
import io.jsonwebtoken.JwtParserBuilder;
@@ -86,7 +87,7 @@ public class DefaultJwtParserBuilder implements JwtParserBuilder {
8687
@SuppressWarnings("deprecation") //TODO: remove for 1.0
8788
private SigningKeyResolver signingKeyResolver = null;
8889

89-
private Registry<String, AeadAlgorithm> encAlgs = Jwts.ENC.get();
90+
private Registry<String, AeadAlgorithm> encAlgs = Jwe.alg.registry();
9091

9192
private Registry<String, KeyAlgorithm<?, ?>> keyAlgs = Jwts.KEY.get();
9293

0 commit comments

Comments
 (0)