Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ELY-2767] CredentialStoreCommandTest.testGenerateKeyPairDSA fails when using Java 22 #2157

Merged
merged 1 commit into from
Sep 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading