Methods Summary |
---|
private boolean | certificateExists(java.security.cert.X509Certificate x509Certificate)
if (mTrustStore == null) return false;
return (mTrustStore.getCertificateAlias(x509Certificate) == null ?
false : true);
|
protected void | checkCertificate(java.security.cert.X509Certificate[] chain)This function validates the cert and ensures that it is trusted.
if (chain == null || chain.length == 0) {
throw new IllegalArgumentException (_strMgr.getString(
"emptyServerCertificate"));
}
//First ensure that the certificate is valid.
for (int i = 0 ; i < chain.length ; i ++)
chain[i].checkValidity();
try {
// if the certificate does not exist then we have an issue. If
// the cert was not changed on the DAS post a DAS/NA sync then
// some DAS with which this NA did not sync up earlier has been
// conencted to from NA. Throw an exception and abort NA startup
if (!certificateExists(chain[0]))
throw new CertificateException(
_strMgr.getString("serverCertificateNotTrusted"));
} catch (Exception ex) {
// mask all exceptions as CertificateException
// but with correct diagnostic message
// the exception could be a KeyStoreException or ConfigException
// while trying to fetch correct trust store
throw new CertificateException(ex.getMessage());
}
|
public void | checkClientTrusted(java.security.cert.X509Certificate[] x509Certificate, java.lang.String authType)Checks if client is trusted given the certificate chain and
authorization type string, e.g. "RSA".
throw new UnsupportedOperationException(
"Not Implemented for Client Trust Management");
|
public void | checkServerTrusted(java.security.cert.X509Certificate[] chain, java.lang.String authType)Checs if the server is trusted.
try {
checkCertificate(chain);
} catch (CertificateException ex) {
throw ex;
}
|
public java.security.cert.X509Certificate[] | getAcceptedIssuers()
return ( new X509Certificate[0] );
|
private java.security.KeyStore | getCertTrustore(java.lang.String certNickname)Returns certificate used by jmx connector.
// available trust stores
SecuritySupport secSupp = SecurityUtil.getSecuritySupport();
KeyStore[] trustStore = secSupp.getTrustStores();
int i = 0; boolean found = false;
Certificate cert = null;
for (; i<trustStore.length; i++) {
cert = trustStore[i].getCertificate(certNickname);
if (cert != null) {
// found target
found = true;
break;
}
}
if (found)
if (trustStore != null) return trustStore[i];
return null;
|