FileDocCategorySizeDatePackage
TransportCryptoManager.javaAPI DocAzureus 3.0.3.43175Tue Nov 21 16:13:12 GMT 2006com.aelitis.azureus.core.networkmanager.impl

TransportCryptoManager

public class TransportCryptoManager extends Object

Fields Summary
private static final TransportCryptoManager
instance
Constructors Summary
Methods Summary
public static com.aelitis.azureus.core.networkmanager.impl.TransportCryptoManagergetSingleton()

	
	
	      return instance;  
public voidmanageCrypto(TransportHelper transport, byte[][] shared_secrets, boolean is_incoming, java.nio.ByteBuffer initial_data, com.aelitis.azureus.core.networkmanager.impl.TransportCryptoManager$HandshakeListener listener)

						
			try{
				new ProtocolDecoderInitial( 
						transport, 
						shared_secrets,
						!is_incoming,
						initial_data,
						new ProtocolDecoderAdapter()
						{
							public int
							getMaximumPlainHeaderLength()
							{
								return( listener.getMaximumPlainHeaderLength());
							}
							
							public int
							matchPlainHeader(
								ByteBuffer			buffer )
							{
								return( listener.matchPlainHeader( buffer ));
							}

							public void
							gotSecret(
								byte[]				session_secret )
							{
								listener.gotSecret( session_secret );
							}
							
							public void
							decodeComplete(
								ProtocolDecoder	decoder,
								ByteBuffer		remaining_initial_data )
							{
								listener.handshakeSuccess( decoder, remaining_initial_data );
							}
							
							public void
							decodeFailed(
								ProtocolDecoder	decoder,
								Throwable			cause )
							{
								listener.handshakeFailure( cause );
							}
						});
			}catch( Throwable e ){
				
				listener.handshakeFailure( e );
			}