FileDocCategorySizeDatePackage
TLSParams.javaAPI DocGlassfish v2 API4701Fri May 04 22:30:32 BST 2007com.sun.appserv.management.client

TLSParams

public final class TLSParams extends Object
Class encapsulating parameters available for use with TLS.
see
com.sun.appserv.management.client.TrustStoreTrustManager
see
com.sun.appserv.management.client.TrustAnyTrustManager
see
com.sun.appserv.management.client.HandshakeCompletedListenerImpl

Fields Summary
private final X509TrustManager[]
mTrustManagers
private final HandshakeCompletedListener
mHandshakeCompletedListener
Constructors Summary
public TLSParams(File trustStore, char[] trustStorePassword, boolean prompt, HandshakeCompletedListener handshakeCompletedListener)

param
trustStore
param
trustStorePassword
param
prompt
param
handshakeCompletedListener (may be null)

		this(  getTrustManagers( trustStore, trustStorePassword, prompt), handshakeCompletedListener );
		
	
public TLSParams(X509TrustManager[] trustManagers, HandshakeCompletedListener handshakeCompletedListener)

param
trustManagers
param
handshakeCompletedListener (may be null)

		if ( trustManagers == null )
		{
			throw new IllegalArgumentException();
		}
		
    	mTrustManagers		= trustManagers;
    	mHandshakeCompletedListener	= handshakeCompletedListener;
	
public TLSParams(X509TrustManager trustManager, HandshakeCompletedListener handshakeCompletedListener)

param
trustManager
param
handshakeCompletedListener (may be null)

		this( new X509TrustManager[] { trustManager }, handshakeCompletedListener );
	
Methods Summary
public javax.net.ssl.HandshakeCompletedListenergetHandshakeCompletedListener()

return
the HandshakeCompletedListener in use or null if none

    	return( mHandshakeCompletedListener );
    
public static javax.net.ssl.X509TrustManager[]getTrustManagers(java.io.File trustStore, char[] trustStorePassword, boolean prompt)
Return a X509TrustManager[] supporting trust via the specified trustStore file using the specified password.

param
trustStore
param
trustStorePassword password to use for the trustStore file
param
prompt whether to prompt via System.out/in for addition of new certificates

		final TrustStoreTrustManager	mgr	=
			new TrustStoreTrustManager( trustStore, trustStorePassword );
		mgr.setPrompt( prompt );
			
		final X509TrustManager[]	trustMgrs	= new X509TrustManager[] { mgr };
		
		return( trustMgrs );
	
public javax.net.ssl.X509TrustManager[]getTrustManagers()

return
the TrustManagers in use

    	return( mTrustManagers );