Package org.apache.derby.client.net
Class NaiveTrustManager
- java.lang.Object
-
- org.apache.derby.client.net.NaiveTrustManager
-
- All Implemented Interfaces:
javax.net.ssl.TrustManager,javax.net.ssl.X509TrustManager
class NaiveTrustManager extends java.lang.Object implements javax.net.ssl.X509TrustManagerThis is a naive trust manager we use when we don't want server authentication. Any certificate will be accepted.
-
-
Field Summary
Fields Modifier and Type Field Description private static javax.net.ssl.TrustManager[]thisManager
-
Constructor Summary
Constructors Modifier Constructor Description privateNaiveTrustManager()We don't want more than one instence of this TrustManager
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckClientTrusted(java.security.cert.X509Certificate[] chain, java.lang.String authType)Checks wether the we trust the client.voidcheckServerTrusted(java.security.cert.X509Certificate[] chain, java.lang.String authType)Checks wether the we trust the server, which we allways will.java.security.cert.X509Certificate[]getAcceptedIssuers()Return an array of certificate authority certificates which are trusted for authenticating peers.(package private) static javax.net.SocketFactorygetSocketFactory()Generate a socket factory with this trust manager.
-
-
-
Method Detail
-
getSocketFactory
static javax.net.SocketFactory getSocketFactory() throws java.security.NoSuchAlgorithmException, java.security.KeyManagementException, java.security.NoSuchProviderException, java.security.KeyStoreException, java.security.UnrecoverableKeyException, java.security.cert.CertificateException, java.io.IOExceptionGenerate a socket factory with this trust manager. Derby Utility routine which is not part of the X509TrustManager interface.- Throws:
java.security.NoSuchAlgorithmExceptionjava.security.KeyManagementExceptionjava.security.NoSuchProviderExceptionjava.security.KeyStoreExceptionjava.security.UnrecoverableKeyExceptionjava.security.cert.CertificateExceptionjava.io.IOException
-
checkClientTrusted
public void checkClientTrusted(java.security.cert.X509Certificate[] chain, java.lang.String authType) throws java.security.cert.CertificateExceptionChecks wether the we trust the client. Since this trust manager is just for the Derby clients, this routine is actually never called, but need to be here when we implement X509TrustManager.- Specified by:
checkClientTrustedin interfacejavax.net.ssl.X509TrustManager- Parameters:
chain- The client's certificate chainauthType- authorization type (e.g. "RSA" or "DHE_DSS")- Throws:
java.security.cert.CertificateException
-
checkServerTrusted
public void checkServerTrusted(java.security.cert.X509Certificate[] chain, java.lang.String authType) throws java.security.cert.CertificateExceptionChecks wether the we trust the server, which we allways will.- Specified by:
checkServerTrustedin interfacejavax.net.ssl.X509TrustManager- Parameters:
chain- The server's certificate chainauthType- authorization type (e.g. "RSA" or "DHE_DSS")- Throws:
java.security.cert.CertificateException
-
getAcceptedIssuers
public java.security.cert.X509Certificate[] getAcceptedIssuers()
Return an array of certificate authority certificates which are trusted for authenticating peers. Not relevant for this trust manager.- Specified by:
getAcceptedIssuersin interfacejavax.net.ssl.X509TrustManager
-
-