Java EE 5 SDK

com.sun.appserv.management.client
Class TrustAnyTrustManager

java.lang.Object
  extended by com.sun.appserv.management.client.TrustAnyTrustManager
All Implemented Interfaces:
TrustManager, X509TrustManager

public final class TrustAnyTrustManager
extends Object
implements X509TrustManager

This TrustManager applies no logic as to whether its peer certificate is trusted; it trusts all peers. This is a security risk, and should be used only for convenience in testing or where security is explicitly not an issue.


Method Summary
 void checkClientTrusted(X509Certificate[] chain, String authType)
          WARNING: does nothing; all clients are always trusted.
 void checkServerTrusted(X509Certificate[] chain, String authType)
          WARNING: does nothing; all servers are always trusted.
 X509Certificate[] getAcceptedIssuers()
           
static TrustAnyTrustManager getInstance()
          Get an instance; only one is ever created.
static TrustAnyTrustManager[] getInstanceArray()
          Calls getInstance() and returns an array containing it.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getInstance

public static TrustAnyTrustManager getInstance()
Get an instance; only one is ever created.


getInstanceArray

public static TrustAnyTrustManager[] getInstanceArray()
Calls getInstance() and returns an array containing it.


checkClientTrusted

public void checkClientTrusted(X509Certificate[] chain,
                               String authType)
                        throws CertificateException
WARNING: does nothing; all clients are always trusted.

Specified by:
checkClientTrusted in interface X509TrustManager
Throws:
CertificateException

checkServerTrusted

public void checkServerTrusted(X509Certificate[] chain,
                               String authType)
                        throws CertificateException
WARNING: does nothing; all servers are always trusted.

Specified by:
checkServerTrusted in interface X509TrustManager
Throws:
CertificateException

getAcceptedIssuers

public X509Certificate[] getAcceptedIssuers()
Specified by:
getAcceptedIssuers in interface X509TrustManager
Returns:
an empty array.

toString

public String toString()
Overrides:
toString in class Object

Java EE 5 SDK

Submit a bug or feature

Copyright 2006 Sun Microsystems, Inc. All rights reserved.