@@ -70,28 +70,29 @@ static <T> T get(Registry<String, ?> registry, String id) {
70
70
* <blockquote><pre>
71
71
* Jwts.builder()
72
72
* // ... 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...
74
74
* .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>
76
76
*
77
- * @see #get ()
77
+ * @see Jwe.alg#registry ()
78
78
* @since 0.12.0
79
+ * @deprecated since JJWT_RELEASE_VERSION in favor of {@link Jwe.alg}.
79
80
*/
81
+ @ Deprecated
80
82
public static final class ENC {
81
83
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
-
85
84
/**
86
85
* Returns all standard JWA <a href="https://www.rfc-editor.org/rfc/rfc7518.html#section-5">Cryptographic
87
86
* Algorithms for Content Encryption</a> defined in the
88
87
* <a href="https://www.rfc-editor.org/rfc/rfc7518.html#section-7.1">JSON Web Signature and Encryption
89
88
* Algorithms Registry</a>.
90
89
*
91
90
* @return all standard JWA content encryption algorithms.
91
+ * @deprecated since JJWT_RELEASE_VERSION in favor of {@link Jwe.alg#registry()}.
92
92
*/
93
+ @ Deprecated
93
94
public static Registry <String , AeadAlgorithm > get () {
94
- return REGISTRY ;
95
+ return Jwe . alg . registry () ;
95
96
}
96
97
97
98
// prevent instantiation
@@ -102,43 +103,56 @@ private ENC() {
102
103
* {@code AES_128_CBC_HMAC_SHA_256} authenticated encryption algorithm as defined by
103
104
* <a href="https://tools.ietf.org/html/rfc7518#section-5.2.3">RFC 7518, Section 5.2.3</a>. This algorithm
104
105
* requires a 256-bit (32 byte) key.
106
+ *
107
+ * @deprecated since JJWT_RELEASE_VERSION in favor of {@link Jwe.alg#A128CBC_HS256}.
105
108
*/
106
- public static final AeadAlgorithm A128CBC_HS256 = get ().forKey ("A128CBC-HS256" );
109
+ @ Deprecated
110
+ public static final AeadAlgorithm A128CBC_HS256 = Jwe .alg .A128CBC_HS256 ;
107
111
108
112
/**
109
113
* {@code AES_192_CBC_HMAC_SHA_384} authenticated encryption algorithm, as defined by
110
114
* <a href="https://tools.ietf.org/html/rfc7518#section-5.2.4">RFC 7518, Section 5.2.4</a>. This algorithm
111
115
* requires a 384-bit (48 byte) key.
116
+ * @deprecated since JJWT_RELEASE_VERSION in favor of {@link Jwe.alg#A192CBC_HS384}.
112
117
*/
113
- public static final AeadAlgorithm A192CBC_HS384 = get ().forKey ("A192CBC-HS384" );
118
+ @ Deprecated
119
+ public static final AeadAlgorithm A192CBC_HS384 = Jwe .alg .A192CBC_HS384 ;
114
120
115
121
/**
116
122
* {@code AES_256_CBC_HMAC_SHA_512} authenticated encryption algorithm, as defined by
117
123
* <a href="https://tools.ietf.org/html/rfc7518#section-5.2.5">RFC 7518, Section 5.2.5</a>. This algorithm
118
124
* requires a 512-bit (64 byte) key.
125
+ * @deprecated since JJWT_RELEASE_VERSION in favor of {@link Jwe.alg#A256CBC_HS512}.
119
126
*/
120
- public static final AeadAlgorithm A256CBC_HS512 = get ().forKey ("A256CBC-HS512" );
127
+ @ Deprecated
128
+ public static final AeadAlgorithm A256CBC_HS512 = Jwe .alg .A256CBC_HS512 ;
121
129
122
130
/**
123
131
* "AES GCM using 128-bit key" as defined by
124
132
* <a href="https://tools.ietf.org/html/rfc7518#section-5.3">RFC 7518, Section 5.3</a>. This
125
133
* algorithm requires a 128-bit (16 byte) key.
134
+ * @deprecated since JJWT_RELEASE_VERSION in favor of {@link Jwe.alg#A128GCM}.
126
135
*/
127
- public static final AeadAlgorithm A128GCM = get ().forKey ("A128GCM" );
136
+ @ Deprecated
137
+ public static final AeadAlgorithm A128GCM = Jwe .alg .A128GCM ;
128
138
129
139
/**
130
140
* "AES GCM using 192-bit key" as defined by
131
141
* <a href="https://tools.ietf.org/html/rfc7518#section-5.3">RFC 7518, Section 5.3</a>. This
132
142
* algorithm requires a 192-bit (24 byte) key.
143
+ * @deprecated since JJWT_RELEASE_VERSION in favor of {@link Jwe.alg#A192GCM}.
133
144
*/
134
- public static final AeadAlgorithm A192GCM = get ().forKey ("A192GCM" );
145
+ @ Deprecated
146
+ public static final AeadAlgorithm A192GCM = Jwe .alg .A192GCM ;
135
147
136
148
/**
137
149
* "AES GCM using 256-bit key" as defined by
138
150
* <a href="https://tools.ietf.org/html/rfc7518#section-5.3">RFC 7518, Section 5.3</a>. This
139
151
* algorithm requires a 256-bit (32 byte) key.
152
+ * @deprecated since JJWT_RELEASE_VERSION in favor of {@link Jwe.alg#A256GCM}.
140
153
*/
141
- public static final AeadAlgorithm A256GCM = get ().forKey ("A256GCM" );
154
+ @ Deprecated
155
+ public static final AeadAlgorithm A256GCM = Jwe .alg .A256GCM ;
142
156
}
143
157
144
158
/**
@@ -296,6 +310,7 @@ private SIG() {
296
310
* {@code ECDSA using P-256 and SHA-256} signature algorithm as defined by
297
311
* <a href="https://www.rfc-editor.org/rfc/rfc7518.html#section-3.4">RFC 7518, Section 3.4</a>. This algorithm
298
312
* requires a 256-bit key.
313
+ *
299
314
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link Jws.alg#ES256}
300
315
*/
301
316
@ Deprecated
@@ -305,6 +320,7 @@ private SIG() {
305
320
* {@code ECDSA using P-384 and SHA-384} signature algorithm as defined by
306
321
* <a href="https://www.rfc-editor.org/rfc/rfc7518.html#section-3.4">RFC 7518, Section 3.4</a>. This algorithm
307
322
* requires a 384-bit key.
323
+ *
308
324
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link Jws.alg#ES384}
309
325
*/
310
326
@ Deprecated
@@ -314,6 +330,7 @@ private SIG() {
314
330
* {@code ECDSA using P-521 and SHA-512} signature algorithm as defined by
315
331
* <a href="https://www.rfc-editor.org/rfc/rfc7518.html#section-3.4">RFC 7518, Section 3.4</a>. This algorithm
316
332
* requires a 521-bit key.
333
+ *
317
334
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link Jws.alg#ES512}
318
335
*/
319
336
@ Deprecated
@@ -337,6 +354,7 @@ private SIG() {
337
354
*
338
355
* <p><b><sup>1</sup>This algorithm requires at least JDK 15 or a compatible JCA Provider (like BouncyCastle) in the runtime
339
356
* classpath.</b></p>
357
+ *
340
358
* @deprecated since JJWT_RELEASE_VERSION in favor of {@link Jws.alg#EdDSA}
341
359
*/
342
360
@ Deprecated
@@ -350,7 +368,7 @@ private SIG() {
350
368
* <blockquote><pre>
351
369
* Jwts.builder()
352
370
* // ... 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)
354
372
* .build();</pre></blockquote>
355
373
* <p>They are also available together as a {@link Registry} instance via the {@link #get()} method.</p>
356
374
*
0 commit comments