Skip to content

Commit

Permalink
[ELY-2767] CredentialStoreCommandTest.testGenerateKeyPairDSA fails wh…
Browse files Browse the repository at this point in the history
…en using Java 22
  • Loading branch information
lvydra committed Jun 14, 2024
1 parent b80aa6a commit 417b8c8
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import java.security.interfaces.RSAMultiPrimePrivateCrtKey;
import java.security.interfaces.RSAPrivateKey;
import java.security.spec.AlgorithmParameterSpec;
import java.security.spec.DSAParameterSpec;
import java.security.spec.ECParameterSpec;
import java.util.Arrays;
import java.util.Objects;
Expand Down Expand Up @@ -99,7 +100,9 @@ public static <P extends AlgorithmParameterSpec> P getParameters(Key key, Class<
} else if (key instanceof RSAKey && paramSpecClass.isAssignableFrom(RSAParameterSpec.class)) {
return paramSpecClass.cast(new RSAParameterSpec((RSAKey) key));
} else if (key instanceof DSAKey && paramSpecClass.isAssignableFrom(DSAParams.class)) {
return paramSpecClass.cast(((DSAKey) key).getParams());
final DSAKey dsaKey = (DSAKey) key;
final DSAParams dsaParams = dsaKey.getParams();
return paramSpecClass.cast(new DSAParameterSpec(dsaParams.getP(), dsaParams.getQ(), dsaParams.getG()));
} else if (key instanceof ECKey && paramSpecClass.isAssignableFrom(ECParameterSpec.class)) {
return paramSpecClass.cast(((ECKey) key).getParams());
} else if (key instanceof DHKey && paramSpecClass.isAssignableFrom(DHParameterSpec.class)) {
Expand Down

0 comments on commit 417b8c8

Please sign in to comment.