Package edu.uiuc.ncsa.security.util.ssl
Class MyTrustManager
- java.lang.Object
-
- edu.uiuc.ncsa.security.util.ssl.MyTrustManager
-
- All Implemented Interfaces:
TrustManager
,X509TrustManager
public class MyTrustManager extends Object implements X509TrustManager
-
-
Field Summary
Fields Modifier and Type Field Description String
DEFAULT_TRUST_ROOT_PATH
-
Constructor Summary
Constructors Constructor Description MyTrustManager(MyLoggingFacade logger, SSLConfiguration sslConfiguration)
MyTrustManager(MyLoggingFacade logger, String trustRootPath, String serverDN)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkClientTrusted(X509Certificate[] certs, String authType)
protected void
checkServerCertPath(X509Certificate[] certs)
void
checkServerTrusted(X509Certificate[] certs, String authType)
X509Certificate[]
getAcceptedIssuers()
String
getHost()
protected X509Certificate[]
getIssuersFromDirectory(File dir)
Try to read the key store certs from a directory of certificates.protected X509Certificate[]
getIssuersFromFile(File certFile)
Read the certs for the key store from a JKS fileMyLoggingFacade
getLogger()
String
getServerDN()
SSLConfiguration
getSslConfiguration()
String
getTrustRootPath()
boolean
hasServerDN()
protected boolean
hasSSLConfiguration()
boolean
isRequestTrustRoots()
void
setHost(String host)
void
setRequestTrustRoots(boolean requestTrustRoots)
void
setServerDN(String serverDN)
void
setTrustRootPath(String trustRootPath)
-
-
-
Field Detail
-
DEFAULT_TRUST_ROOT_PATH
public final String DEFAULT_TRUST_ROOT_PATH
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MyTrustManager
public MyTrustManager(MyLoggingFacade logger, SSLConfiguration sslConfiguration)
-
MyTrustManager
public MyTrustManager(MyLoggingFacade logger, String trustRootPath, String serverDN)
-
-
Method Detail
-
getSslConfiguration
public SSLConfiguration getSslConfiguration()
-
hasServerDN
public boolean hasServerDN()
-
getServerDN
public String getServerDN()
-
setServerDN
public void setServerDN(String serverDN)
-
getLogger
public MyLoggingFacade getLogger()
-
hasSSLConfiguration
protected boolean hasSSLConfiguration()
-
getTrustRootPath
public String getTrustRootPath()
-
setTrustRootPath
public void setTrustRootPath(String trustRootPath)
-
isRequestTrustRoots
public boolean isRequestTrustRoots()
-
setRequestTrustRoots
public void setRequestTrustRoots(boolean requestTrustRoots)
-
getHost
public String getHost()
-
setHost
public void setHost(String host)
-
getIssuersFromDirectory
protected X509Certificate[] getIssuersFromDirectory(File dir)
Try to read the key store certs from a directory of certificates.- Returns:
-
getIssuersFromFile
protected X509Certificate[] getIssuersFromFile(File certFile)
Read the certs for the key store from a JKS file- Returns:
-
getAcceptedIssuers
public X509Certificate[] getAcceptedIssuers()
- Specified by:
getAcceptedIssuers
in interfaceX509TrustManager
-
checkClientTrusted
public void checkClientTrusted(X509Certificate[] certs, String authType) throws CertificateException
- Specified by:
checkClientTrusted
in interfaceX509TrustManager
- Throws:
CertificateException
-
checkServerTrusted
public void checkServerTrusted(X509Certificate[] certs, String authType) throws CertificateException
- Specified by:
checkServerTrusted
in interfaceX509TrustManager
- Throws:
CertificateException
-
checkServerCertPath
protected void checkServerCertPath(X509Certificate[] certs) throws CertificateException
- Throws:
CertificateException
-
-