Package org.apache.derby.impl.drda
Class NaiveTrustManager
java.lang.Object
org.apache.derby.impl.drda.NaiveTrustManager
- All Implemented Interfaces:
TrustManager
,X509TrustManager
This is a naive trust manager we use when we don't want server
authentication. Any certificate will be accepted.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
We don't want more than one instence of this TrustManager -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkClientTrusted
(X509Certificate[] chain, String authType) Checks wether the we trust the client.void
checkServerTrusted
(X509Certificate[] chain, String authType) Checks wether the we trust the server, which we allways will.Return an array of certificate authority certificates which are trusted for authenticating peers.static SocketFactory
Generate a socket factory with this trust manager.
-
Field Details
-
thisManager
-
-
Constructor Details
-
NaiveTrustManager
private NaiveTrustManager()We don't want more than one instence of this TrustManager
-
-
Method Details
-
getSocketFactory
public static SocketFactory getSocketFactory() throws NoSuchAlgorithmException, KeyManagementException, NoSuchProviderException, KeyStoreException, UnrecoverableKeyException, CertificateException, IOExceptionGenerate a socket factory with this trust manager. Derby Utility routine which is not part of the X509TrustManager interface. -
checkClientTrusted
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException Checks 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:
checkClientTrusted
in interfaceX509TrustManager
- Parameters:
chain
- The client's certificate chainauthType
- authorization type (e.g. "RSA" or "DHE_DSS")- Throws:
CertificateException
-
checkServerTrusted
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException Checks wether the we trust the server, which we allways will.- Specified by:
checkServerTrusted
in interfaceX509TrustManager
- Parameters:
chain
- The server's certificate chainauthType
- authorization type (e.g. "RSA" or "DHE_DSS")- Throws:
CertificateException
-
getAcceptedIssuers
Return an array of certificate authority certificates which are trusted for authenticating peers. Not relevant for this trust manager.- Specified by:
getAcceptedIssuers
in interfaceX509TrustManager
-