@@ -37,7 +37,7 @@ public static Algorithm RSA256(RSAKeyProvider keyProvider) throws IllegalArgumen
3737 * @throws IllegalArgumentException if both provided Keys are null.
3838 */
3939 public static Algorithm RSA256 (RSAPublicKey publicKey , RSAPrivateKey privateKey ) throws IllegalArgumentException {
40- return new RSAAlgorithm ( "RS256" , "SHA256withRSA" , publicKey , privateKey );
40+ return RSA256 ( RSAAlgorithm . providerForKeys ( publicKey , privateKey ) );
4141 }
4242
4343 /**
@@ -46,7 +46,7 @@ public static Algorithm RSA256(RSAPublicKey publicKey, RSAPrivateKey privateKey)
4646 * @param key the key to use in the verify or signing instance.
4747 * @return a valid RSA256 Algorithm.
4848 * @throws IllegalArgumentException if the Key Provider is null.
49- * @deprecated use {@link #RSA256(RSAPublicKey, RSAPrivateKey)}
49+ * @deprecated use {@link #RSA256(RSAPublicKey, RSAPrivateKey)} or {@link #RSA256(RSAKeyProvider)}
5050 */
5151 @ Deprecated
5252 public static Algorithm RSA256 (RSAKey key ) throws IllegalArgumentException {
@@ -75,7 +75,7 @@ public static Algorithm RSA384(RSAKeyProvider keyProvider) throws IllegalArgumen
7575 * @throws IllegalArgumentException if both provided Keys are null.
7676 */
7777 public static Algorithm RSA384 (RSAPublicKey publicKey , RSAPrivateKey privateKey ) throws IllegalArgumentException {
78- return new RSAAlgorithm ( "RS384" , "SHA384withRSA" , publicKey , privateKey );
78+ return RSA384 ( RSAAlgorithm . providerForKeys ( publicKey , privateKey ) );
7979 }
8080
8181 /**
@@ -84,7 +84,7 @@ public static Algorithm RSA384(RSAPublicKey publicKey, RSAPrivateKey privateKey)
8484 * @param key the key to use in the verify or signing instance.
8585 * @return a valid RSA384 Algorithm.
8686 * @throws IllegalArgumentException if the provided Key is null.
87- * @deprecated use {@link #RSA384(RSAPublicKey, RSAPrivateKey)}
87+ * @deprecated use {@link #RSA384(RSAPublicKey, RSAPrivateKey)} or {@link #RSA384(RSAKeyProvider)}
8888 */
8989 @ Deprecated
9090 public static Algorithm RSA384 (RSAKey key ) throws IllegalArgumentException {
@@ -113,7 +113,7 @@ public static Algorithm RSA512(RSAKeyProvider keyProvider) throws IllegalArgumen
113113 * @throws IllegalArgumentException if both provided Keys are null.
114114 */
115115 public static Algorithm RSA512 (RSAPublicKey publicKey , RSAPrivateKey privateKey ) throws IllegalArgumentException {
116- return new RSAAlgorithm ( "RS512" , "SHA512withRSA" , publicKey , privateKey );
116+ return RSA512 ( RSAAlgorithm . providerForKeys ( publicKey , privateKey ) );
117117 }
118118
119119 /**
@@ -122,7 +122,7 @@ public static Algorithm RSA512(RSAPublicKey publicKey, RSAPrivateKey privateKey)
122122 * @param key the key to use in the verify or signing instance.
123123 * @return a valid RSA512 Algorithm.
124124 * @throws IllegalArgumentException if the provided Key is null.
125- * @deprecated use {@link #RSA512(RSAPublicKey, RSAPrivateKey)}
125+ * @deprecated use {@link #RSA512(RSAPublicKey, RSAPrivateKey)} or {@link #RSA512(RSAKeyProvider)}
126126 */
127127 @ Deprecated
128128 public static Algorithm RSA512 (RSAKey key ) throws IllegalArgumentException {
@@ -220,7 +220,7 @@ public static Algorithm ECDSA256(ECKeyProvider keyProvider) throws IllegalArgume
220220 * @throws IllegalArgumentException if the provided Key is null.
221221 */
222222 public static Algorithm ECDSA256 (ECPublicKey publicKey , ECPrivateKey privateKey ) throws IllegalArgumentException {
223- return new ECDSAAlgorithm ( "ES256" , "SHA256withECDSA" , 32 , publicKey , privateKey );
223+ return ECDSA256 ( ECDSAAlgorithm . providerForKeys ( publicKey , privateKey ) );
224224 }
225225
226226 /**
@@ -229,7 +229,7 @@ public static Algorithm ECDSA256(ECPublicKey publicKey, ECPrivateKey privateKey)
229229 * @param key the key to use in the verify or signing instance.
230230 * @return a valid ECDSA256 Algorithm.
231231 * @throws IllegalArgumentException if the provided Key is null.
232- * @deprecated use {@link #ECDSA256(ECPublicKey, ECPrivateKey)}
232+ * @deprecated use {@link #ECDSA256(ECPublicKey, ECPrivateKey)} or {@link #ECDSA256(ECKeyProvider)}
233233 */
234234 @ Deprecated
235235 public static Algorithm ECDSA256 (ECKey key ) throws IllegalArgumentException {
@@ -258,7 +258,7 @@ public static Algorithm ECDSA384(ECKeyProvider keyProvider) throws IllegalArgume
258258 * @throws IllegalArgumentException if the provided Key is null.
259259 */
260260 public static Algorithm ECDSA384 (ECPublicKey publicKey , ECPrivateKey privateKey ) throws IllegalArgumentException {
261- return new ECDSAAlgorithm ( "ES384" , "SHA384withECDSA" , 48 , publicKey , privateKey );
261+ return ECDSA384 ( ECDSAAlgorithm . providerForKeys ( publicKey , privateKey ) );
262262 }
263263
264264 /**
@@ -267,7 +267,7 @@ public static Algorithm ECDSA384(ECPublicKey publicKey, ECPrivateKey privateKey)
267267 * @param key the key to use in the verify or signing instance.
268268 * @return a valid ECDSA384 Algorithm.
269269 * @throws IllegalArgumentException if the provided Key is null.
270- * @deprecated use {@link #ECDSA384(ECPublicKey, ECPrivateKey)}
270+ * @deprecated use {@link #ECDSA384(ECPublicKey, ECPrivateKey)} or {@link #ECDSA384(ECKeyProvider)}
271271 */
272272 @ Deprecated
273273 public static Algorithm ECDSA384 (ECKey key ) throws IllegalArgumentException {
@@ -296,7 +296,7 @@ public static Algorithm ECDSA512(ECKeyProvider keyProvider) throws IllegalArgume
296296 * @throws IllegalArgumentException if the provided Key is null.
297297 */
298298 public static Algorithm ECDSA512 (ECPublicKey publicKey , ECPrivateKey privateKey ) throws IllegalArgumentException {
299- return new ECDSAAlgorithm ( "ES512" , "SHA512withECDSA" , 66 , publicKey , privateKey );
299+ return ECDSA512 ( ECDSAAlgorithm . providerForKeys ( publicKey , privateKey ) );
300300 }
301301
302302 /**
@@ -305,7 +305,7 @@ public static Algorithm ECDSA512(ECPublicKey publicKey, ECPrivateKey privateKey)
305305 * @param key the key to use in the verify or signing instance.
306306 * @return a valid ECDSA512 Algorithm.
307307 * @throws IllegalArgumentException if the provided Key is null.
308- * @deprecated use {@link #ECDSA512(ECPublicKey, ECPrivateKey)}
308+ * @deprecated use {@link #ECDSA512(ECPublicKey, ECPrivateKey)} or {@link #ECDSA512(ECKeyProvider)}
309309 */
310310 @ Deprecated
311311 public static Algorithm ECDSA512 (ECKey key ) throws IllegalArgumentException {
0 commit comments