20
20
import io .jsonwebtoken .lang .Classes ;
21
21
import io .jsonwebtoken .lang .Registry ;
22
22
import io .jsonwebtoken .security .AeadAlgorithm ;
23
- import io .jsonwebtoken .security .AeadRequest ;
24
- import io .jsonwebtoken .security .AeadResult ;
25
- import io .jsonwebtoken .security .DecryptAeadRequest ;
26
- import io .jsonwebtoken .security .DecryptionKeyRequest ;
27
23
import io .jsonwebtoken .security .KeyAlgorithm ;
28
24
import io .jsonwebtoken .security .KeyPairBuilderSupplier ;
29
- import io .jsonwebtoken .security .KeyRequest ;
30
25
import io .jsonwebtoken .security .MacAlgorithm ;
31
26
import io .jsonwebtoken .security .Password ;
32
- import io .jsonwebtoken .security .Request ;
33
27
import io .jsonwebtoken .security .SecretKeyAlgorithm ;
34
28
import io .jsonwebtoken .security .SecureDigestAlgorithm ;
35
- import io .jsonwebtoken .security .SecureRequest ;
36
29
import io .jsonwebtoken .security .SignatureAlgorithm ;
37
- import io .jsonwebtoken .security .VerifyDigestRequest ;
38
- import io .jsonwebtoken .security .VerifySecureDigestRequest ;
39
30
import io .jsonwebtoken .security .X509Builder ;
40
31
41
32
import javax .crypto .SecretKey ;
42
- import java .io .InputStream ;
43
- import java .io .OutputStream ;
44
33
import java .security .Key ;
45
34
import java .security .PrivateKey ;
46
35
import java .security .PublicKey ;
@@ -93,18 +82,6 @@ public static final class ENC {
93
82
private static final String IMPL_CLASSNAME = "io.jsonwebtoken.impl.security.StandardEncryptionAlgorithms" ;
94
83
private static final Registry <String , AeadAlgorithm > REGISTRY = Classes .newInstance (IMPL_CLASSNAME );
95
84
96
- // @since 0.13.0
97
- private static final Supplier <AeadRequest .Builder > REQUEST_BUILDER_SUPPLIER =
98
- Classes .newInstance ("io.jsonwebtoken.impl.security.DefaultAeadRequest$Builder$Supplier" );
99
-
100
- // @since 0.13.0
101
- private static final Supplier <DecryptAeadRequest .Builder > DECRYPT_REQUEST_BUILDER_SUPPLIER =
102
- Classes .newInstance ("io.jsonwebtoken.impl.security.DefaultDecryptAeadRequest$Builder$Supplier" );
103
-
104
- // @since 0.13.0
105
- private static final Supplier <AeadResult .Builder > RESULT_BUILDER_SUPPLIER =
106
- Classes .newInstance ("io.jsonwebtoken.impl.security.DefaultAeadResult$Builder$Supplier" );
107
-
108
85
/**
109
86
* Returns all standard JWA <a href="https://www.rfc-editor.org/rfc/rfc7518.html#section-5">Cryptographic
110
87
* Algorithms for Content Encryption</a> defined in the
@@ -162,42 +139,6 @@ private ENC() {
162
139
* algorithm requires a 256-bit (32 byte) key.
163
140
*/
164
141
public static final AeadAlgorithm A256GCM = get ().forKey ("A256GCM" );
165
-
166
- /**
167
- * Returns a new builder to create {@link AeadRequest}s used for AEAD encryption via
168
- * {@link AeadAlgorithm#encrypt(AeadRequest, AeadResult)}
169
- *
170
- * @return a new builder to create {@link AeadRequest}s used for AEAD encryption via
171
- * {@link AeadAlgorithm#encrypt(AeadRequest, AeadResult)}
172
- * @since 0.13.0
173
- */
174
- public static AeadRequest .Builder request () {
175
- return REQUEST_BUILDER_SUPPLIER .get ();
176
- }
177
-
178
- /**
179
- * Returns a new builder to create {@link DecryptAeadRequest}s used for AEAD decryption via
180
- * {@link AeadAlgorithm#decrypt(DecryptAeadRequest, OutputStream)}
181
- *
182
- * @return a new builder to create {@link DecryptAeadRequest}s used for AEAD decryption via
183
- * {@link AeadAlgorithm#decrypt(DecryptAeadRequest, OutputStream)}
184
- * @since 0.13.0
185
- */
186
- public static DecryptAeadRequest .Builder decryptRequest () {
187
- return DECRYPT_REQUEST_BUILDER_SUPPLIER .get ();
188
- }
189
-
190
- /**
191
- * Returns a new builder to create {@link AeadResult}s used to store AEAD encryption results when calling
192
- * {@link AeadAlgorithm#encrypt(AeadRequest, AeadResult)}
193
- *
194
- * @return a new builder to create {@link AeadResult}s used to store AEAD encryption results when calling
195
- * {@link AeadAlgorithm#encrypt(AeadRequest, AeadResult)}
196
- * @since 0.13.0
197
- */
198
- public static AeadResult .Builder result () {
199
- return RESULT_BUILDER_SUPPLIER .get ();
200
- }
201
142
}
202
143
203
144
/**
@@ -221,14 +162,6 @@ public static final class SIG {
221
162
private static final String IMPL_CLASSNAME = "io.jsonwebtoken.impl.security.StandardSecureDigestAlgorithms" ;
222
163
private static final Registry <String , SecureDigestAlgorithm <?, ?>> REGISTRY = Classes .newInstance (IMPL_CLASSNAME );
223
164
224
- // @since 0.13.0
225
- private static final Supplier <SecureRequest .Builder <InputStream , ?>> REQUEST_BUILDER_SUPPLIER =
226
- Classes .newInstance ("io.jsonwebtoken.impl.security.DefaultSecureRequest$Builder$Supplier" );
227
-
228
- // @since 0.13.0
229
- private static final Supplier <VerifySecureDigestRequest .Builder <?>> VERIFY_REQUEST_BUILDER_SUPPLIER =
230
- Classes .newInstance ("io.jsonwebtoken.impl.security.DefaultVerifySecureDigestRequest$Builder$Supplier" );
231
-
232
165
//prevent instantiation
233
166
private SIG () {
234
167
}
@@ -369,34 +302,6 @@ private SIG() {
369
302
* classpath.</b></p>
370
303
*/
371
304
public static final SignatureAlgorithm EdDSA = Jwts .get (REGISTRY , "EdDSA" );
372
-
373
- /**
374
- * Returns a new builder to create {@link SecureRequest}s used to compute a mac or signature via
375
- * {@link SecureDigestAlgorithm#digest(Request)}.
376
- *
377
- * @param <K> the type of key used by the algorithm to compute the mac or signature.
378
- * @return a new builder to create {@link SecureRequest}s used to compute a mac or signature via
379
- * {@link SecureDigestAlgorithm#digest(Request)}.
380
- * @since 0.13.0
381
- */
382
- @ SuppressWarnings ("unchecked" )
383
- public static <K extends Key > SecureRequest .Builder <InputStream , K > request () {
384
- return (SecureRequest .Builder <InputStream , K >) REQUEST_BUILDER_SUPPLIER .get ();
385
- }
386
-
387
- /**
388
- * Returns a new builder to create {@link VerifySecureDigestRequest}s used to verify a mac or signature via
389
- * {@link SecureDigestAlgorithm#verify(VerifyDigestRequest)}.
390
- *
391
- * @param <K> the type of key used by the algorithm to verify the mac or signature.
392
- * @return a new builder to create {@link VerifySecureDigestRequest}s used to verify a mac or signature via
393
- * {@link SecureDigestAlgorithm#verify(VerifyDigestRequest)}.
394
- * @since 0.13.0
395
- */
396
- @ SuppressWarnings ("unchecked" )
397
- public static <K extends Key > VerifySecureDigestRequest .Builder <K > verifyRequest () {
398
- return (VerifySecureDigestRequest .Builder <K >) VERIFY_REQUEST_BUILDER_SUPPLIER .get ();
399
- }
400
305
}
401
306
402
307
/**
@@ -418,14 +323,6 @@ public static final class KEY {
418
323
private static final String IMPL_CLASSNAME = "io.jsonwebtoken.impl.security.StandardKeyAlgorithms" ;
419
324
private static final Registry <String , KeyAlgorithm <?, ?>> REGISTRY = Classes .newInstance (IMPL_CLASSNAME );
420
325
421
- // @since 0.13.0
422
- private static final Supplier <KeyRequest .Builder <?>> REQUEST_BUILDER_SUPPLIER =
423
- Classes .newInstance ("io.jsonwebtoken.impl.security.DefaultKeyRequest$Builder$Supplier" );
424
-
425
- // @since 0.13.0
426
- private static final Supplier <DecryptionKeyRequest .Builder <?>> VERIFY_REQUEST_BUILDER_SUPPLIER =
427
- Classes .newInstance ("io.jsonwebtoken.impl.security.DefaultDecryptionKeyRequest$Builder$Supplier" );
428
-
429
326
/**
430
327
* Returns all standard JWA standard <a href="https://www.rfc-editor.org/rfc/rfc7518.html#section-4">Cryptographic
431
328
* Algorithms for Key Management</a>..
@@ -1029,34 +926,6 @@ public static final class KEY {
1029
926
*/
1030
927
public static final KeyAlgorithm <PublicKey , PrivateKey > ECDH_ES_A256KW = Jwts .get (REGISTRY , "ECDH-ES+A256KW" );
1031
928
1032
- /**
1033
- * Returns a new builder to create {@link KeyRequest}s used to get a JWE encryption key via
1034
- * {@link KeyAlgorithm#getEncryptionKey(KeyRequest)}.
1035
- *
1036
- * @param <K> the type of key used by the {@link KeyAlgorithm} to get a JWE encryption key.
1037
- * @return a new builder to create {@link KeyRequest}s used to get a JWE encryption key via
1038
- * {@link KeyAlgorithm#getEncryptionKey(KeyRequest)}.
1039
- * @since 0.13.0
1040
- */
1041
- @ SuppressWarnings ("unchecked" )
1042
- public static <K extends Key > KeyRequest .Builder <K > request () {
1043
- return (KeyRequest .Builder <K >) REQUEST_BUILDER_SUPPLIER .get ();
1044
- }
1045
-
1046
- /**
1047
- * Returns a new builder to create {@link DecryptionKeyRequest}s used to get a JWE decryption key via
1048
- * {@link KeyAlgorithm#getDecryptionKey(DecryptionKeyRequest)}.
1049
- *
1050
- * @param <K> the type of key used by the {@link KeyAlgorithm} to get a JWE decryption key.
1051
- * @return a new builder to create {@link DecryptionKeyRequest}s used to get a JWE decryption key via
1052
- * {@link KeyAlgorithm#getDecryptionKey(DecryptionKeyRequest)}.
1053
- * @since 0.13.0
1054
- */
1055
- @ SuppressWarnings ("unchecked" )
1056
- public static <K extends Key > DecryptionKeyRequest .Builder <K > decRequest () {
1057
- return (DecryptionKeyRequest .Builder <K >) VERIFY_REQUEST_BUILDER_SUPPLIER .get ();
1058
- }
1059
-
1060
929
//prevent instantiation
1061
930
private KEY () {
1062
931
}
0 commit comments