Skip to content

Commit eeb7567

Browse files
committed
update to use multiple keytypes
1 parent 236eb8a commit eeb7567

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

cwms-http-client/src/main/java/mil/army/usace/hec/cwms/http/client/auth/CacKeyManager.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
import java.security.Principal;
2929
import java.security.PrivateKey;
3030
import java.security.cert.X509Certificate;
31+
import java.util.Collections;
32+
import java.util.Set;
33+
import java.util.TreeSet;
3134
import java.util.logging.Level;
3235
import java.util.logging.Logger;
3336
import javax.net.ssl.X509KeyManager;
@@ -111,7 +114,14 @@ void setCertificateAlias(String certificateAlias) {
111114
}
112115
}
113116

114-
String[] aliases() {
115-
return delegate.getClientAliases("RSA", null);
117+
Set<String> aliases() {
118+
Set<String> retval = new TreeSet<>();
119+
for(var keyType : new String[]{"RSA", "EC", "DSA"}) {
120+
String[] clientAliases = delegate.getClientAliases(keyType, null);
121+
if(clientAliases != null) {
122+
Collections.addAll(retval, clientAliases);
123+
}
124+
}
125+
return retval;
116126
}
117127
}

0 commit comments

Comments
 (0)