frankgh commented on code in PR #43:
URL:
https://github.com/apache/cassandra-analytics/pull/43#discussion_r1515102552
##########
cassandra-analytics-core/src/main/java/org/apache/cassandra/spark/validation/KeyStoreValidation.java:
##########
@@ -81,6 +84,15 @@ public void validate()
throw new RuntimeException("KeyStore is empty");
}
+ for (Enumeration<String> aliases = keyStore.aliases();
aliases.hasMoreElements();)
+ {
+ Certificate cert =
keyStore.getCertificate(aliases.nextElement());
+ if (cert instanceof X509Certificate)
+ {
+ ((X509Certificate) cert).checkValidity();
+ }
+ }
Review Comment:
Can we collapse the for lops in lines 87 and 96:
```suggestion
for (Enumeration<String> aliases = keyStore.aliases();
aliases.hasMoreElements();)
{
String alias = aliases.nextElement();
Certificate cert = keyStore.getCertificate(alias);
if (cert instanceof X509Certificate)
{
((X509Certificate) cert).checkValidity();
}
Key key = keyStore.getKey(alias, password);
if (key != null && key instanceof PrivateKey)
{
return; // KeyStore contains a private key
}
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]