Top Description Fields Constructors Methods
org.apache.derby.shared.common.drda

public Class NaiveTrustManager

extends Object
implements X509TrustManager
Class Inheritance
All Implemented Interfaces
javax.net.ssl.X509TrustManager, javax.net.ssl.TrustManager
Imports
java.io.FileInputStream, java.security.KeyStore, java.security.cert.CertificateException, .X509Certificate, java.util.Properties, javax.net.SocketFactory, javax.net.ssl.KeyManagerFactory, .SSLContext, .TrustManager, .X509TrustManager

This is a naive trust manager we use when we don't want server authentication. Any certificate will be accepted.

Field Summary

Modifier and TypeField and Description
public static final String
public static final String
private static TrustManager[]

Constructor Summary

AccessConstructor and Description
private
NaiveTrustManager()

We don't want more than one instence of this TrustManager

Method Summary

Modifier and TypeMethod and Description
public void
checkClientTrusted(X509Certificate[]
The client's certificate chain
chain
,
String
authorization type (e.g. "RSA" or "DHE_DSS")
authType
)

Implements javax.net.ssl.X509TrustManager.checkClientTrusted.

Checks wether the we trust the client.
public void
checkServerTrusted(X509Certificate[]
The server's certificate chain
chain
,
String
authorization type (e.g. "RSA" or "DHE_DSS")
authType
)

Implements javax.net.ssl.X509TrustManager.checkServerTrusted.

Checks wether the we trust the server, which we allways will.
public X509Certificate[]
getAcceptedIssuers()

Implements javax.net.ssl.X509TrustManager.getAcceptedIssuers.

Return an array of certificate authority certificates which are trusted for authenticating peers.
public static SocketFactory

Returns:

a socket factory
getSocketFactory
(Properties
Configuration settings for the socket factory
sslProperties
)

Generate a socket factory with this trust manager.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

SSL_KEYSTOREback to summary
public static final String SSL_KEYSTORE
SSL_KEYSTORE_PASSWORDback to summary
public static final String SSL_KEYSTORE_PASSWORD
thisManagerback to summary
private static TrustManager[] thisManager

Constructor Detail

NaiveTrustManagerback to summary
private NaiveTrustManager()

We don't want more than one instence of this TrustManager

Method Detail

checkClientTrustedback to summary
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException

Implements javax.net.ssl.X509TrustManager.checkClientTrusted.

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.

Parameters
chain:X509Certificate[]

The client's certificate chain

authType:String

authorization type (e.g. "RSA" or "DHE_DSS")

Exceptions
CertificateException:

Doc from javax.net.ssl.X509TrustManager.checkClientTrusted.

if the certificate chain is not trusted by this TrustManager.

checkServerTrustedback to summary
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException

Implements javax.net.ssl.X509TrustManager.checkServerTrusted.

Checks wether the we trust the server, which we allways will.

Parameters
chain:X509Certificate[]

The server's certificate chain

authType:String

authorization type (e.g. "RSA" or "DHE_DSS")

Exceptions
CertificateException:

Doc from javax.net.ssl.X509TrustManager.checkServerTrusted.

if the certificate chain is not trusted by this TrustManager.

getAcceptedIssuersback to summary
public X509Certificate[] getAcceptedIssuers()

Implements javax.net.ssl.X509TrustManager.getAcceptedIssuers.

Return an array of certificate authority certificates which are trusted for authenticating peers. Not relevant for this trust manager.

Returns:X509Certificate[]

Doc from javax.net.ssl.X509TrustManager.getAcceptedIssuers.

a non-null (possibly empty) array of acceptable CA issuer certificates.

getSocketFactoryback to summary
public static SocketFactory getSocketFactory(Properties sslProperties) throws NoSuchAlgorithmException, KeyManagementException, NoSuchProviderException, KeyStoreException, UnrecoverableKeyException, CertificateException, IOException

Generate a socket factory with this trust manager. Derby Utility routine which is not part of the X509TrustManager interface.

Parameters
sslProperties:Properties

Configuration settings for the socket factory

Returns:SocketFactory

a socket factory

Exceptions
NoSuchAlgorithmException:
on error
KeyManagementException:
on error
NoSuchProviderException:
on error
KeyStoreException:
on error
UnrecoverableKeyException:
on error
CertificateException:
on error
IOException:
on error