com.pivotal.gemfirexd.internal.client.net

## Class NaiveTrustManager

- java.lang.Object
- - com.pivotal.gemfirexd.internal.client.net.NaiveTrustManager

All Implemented Interfaces:
  TrustManager, X509TrustManager

    public class NaiveTrustManager
    extends Object
    implements X509TrustManager

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

### Method Summary

Methods
`void` `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.
`X509Certificate[]` `getAcceptedIssuers()` Return an array of certificate authority certificates which are trusted for authenticating peers.
`static SocketFactory` `getSocketFactory()` Generate a socket factory with this trust manager.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### getSocketFactory

    public static SocketFactory getSocketFactory()
                                          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.

Throws:
  `NoSuchAlgorithmException`
  `KeyManagementException`
  `NoSuchProviderException`
  `KeyStoreException`
  `UnrecoverableKeyException`
  `CertificateException`
  `IOException`

#### 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 interface `X509TrustManager`
Parameters:
  `chain` - The client's certificate chain
  `authType` - 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 interface `X509TrustManager`
Parameters:
  `chain` - The server's certificate chain
  `authType` - authorization type (e.g. "RSA" or "DHE_DSS")
Throws:
  `CertificateException`

#### getAcceptedIssuers

    public X509Certificate[] getAcceptedIssuers()

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

Specified by:
  `getAcceptedIssuers` in interface `X509TrustManager`