Package org.gudy.azureus2.plugins.utils.security

Examples of org.gudy.azureus2.plugins.utils.security.SESecurityManager


   *
   * @since 3.0.0.7
   */
  private boolean nextUpdate() {
    if (iterDownloaders.hasNext()) {
      ResourceDownloader downloader = (ResourceDownloader) iterDownloaders.next();
      downloader.addListener(this);
      downloader.asyncDownload();
      return true;
    }
    return false;
  }
View Full Code Here


              }
             
              setProgress( 0 );
             
              downloader.addListener(
                new ResourceDownloaderAdapter()
                {
                  public void
                  reportPercentComplete(
                    ResourceDownloader  downloader,
                    int          percentage )
View Full Code Here

            passwordDetails   details)
          {
          }
        });
     
      final SESecurityManager  sec_man = plugin_interface.getUtilities().getSecurityManager();
     
      final SEPublicKey  my_key = sec_man.getPublicKey( SEPublicKey.KEY_TYPE_ECC_192, "test" );

      final int  stream_crypto   = MessageManager.STREAM_ENCRYPTION_RC4_REQUIRED;
      final boolean  use_sts    = true;
      final int  block_crypto   = SESecurityManager.BLOCK_ENCRYPTION_AES;
     
      GenericMessageRegistration  reg =
        plugin_interface.getMessageManager().registerGenericMessageType(
          "GENTEST", "Gen test desc",
          stream_crypto,
          new GenericMessageHandler()
          {
            public boolean
            accept(
              GenericMessageConnection  connection )
           
              throws MessageException
            {
              System.out.println( "accept" );
             
              try{
                if ( use_sts ){
                 
                  connection = sec_man.getSTSConnection(
                      connection,
                      my_key,
                      new SEPublicKeyLocator()
                      {
                        public boolean
                        accept(
                          Object    context,
                          SEPublicKey  other_key )
                        {
                          System.out.println( "acceptKey" );
                         
                          return( true );
                        }
                      },
                      "test",
                      block_crypto );
                }
                   
                connection.addListener(
                  new GenericMessageConnectionListener()
                  {
                    public void
                    connected(
                      GenericMessageConnection  connection )
                    {
                    }
                   
                    public void
                    receive(
                      GenericMessageConnection  connection,
                      PooledByteBuffer      message )
                   
                      throws MessageException
                    {
                      System.out.println( "receive: " + message.toByteArray().length );
                     
                      PooledByteBuffer  reply =
                        plugin_interface.getUtilities().allocatePooledByteBuffer(
                            new byte[connection.getMaximumMessageSize()]);
                     
                      connection.send( reply );
                    }
                   
                    public void
                    failed(
                      GenericMessageConnection  connection,
                      Throwable           error )
                   
                      throws MessageException
                    {
                      System.out.println( "Responder connection error:" );

                      error.printStackTrace();
                   
                  });
               
              }catch( Throwable e ){
               
                connection.close();
               
                e.printStackTrace();
              }
             
              return( true );
            }
          });
     
      InetSocketAddress  tcp_target = new InetSocketAddress( "127.0.0.1",     6889 );
      InetSocketAddress  udp_target = new InetSocketAddress( "212.159.18.92",   6881 );
     
      GenericMessageEndpoint  endpoint = reg.createEndpoint( tcp_target );
     
      endpoint.addTCP( tcp_target );
      endpoint.addUDP( udp_target );
     
      while( true ){
       
        try{
          for (int i=0;i<1000;i++){
           
            System.out.println( "Test: initiating connection" );
           
            final AESemaphore  sem = new AESemaphore( "wait!" );
           
            GenericMessageConnection  con = reg.createConnection( endpoint );
           
            if ( use_sts ){
             
              con = sec_man.getSTSConnection(
                con, my_key,
                new SEPublicKeyLocator()
                {
                  public boolean
                  accept(
View Full Code Here

       
      plugin.addRateLimiters( con );
     
      String reason = "Friend: Outgoing connection establishment";
 
      SESecurityManager sec_man = plugin.getSecurityManager();
     
      con = sec_man.getSTSConnection(
          con,
          sec_man.getPublicKey( SEPublicKey.KEY_TYPE_ECC_192, reason ),
 
          new SEPublicKeyLocator()
          {
            public boolean
            accept(
View Full Code Here

    props         = new propertyWrapper(_props );
    pluginDir       = _pluginDir;
    config         = new PluginConfigImpl(this,pluginConfigKey);
    given_plugin_id      = _plugin_id;
    plugin_version    = _plugin_version;
    ipc_interface      = new IPCInterfaceImpl( initialiser, plugin );
    state                 = new PluginStateImpl(this, initialiser);
   
    boolean verified   = false;
    boolean bad    = false;
   
View Full Code Here

  }
 
  public IPFilter
  getIPFilter()
  {
    return( new IPFilterImpl());
  }
View Full Code Here

 
  public Logger getLogger()
  {
    if ( logger == null ){
     
      logger = new LoggerImpl( this );
    }
   
    return( logger );
  }
View Full Code Here

    else {
      plug_msg = new MessageAdapter( message )//core created
    }
   
    RawMessage raw_plug = plug_encoder.encodeMessage( plug_msg );
    return new com.aelitis.azureus.core.networkmanager.RawMessage[]{ new RawMessageAdapter( raw_plug )};
  }
View Full Code Here

    return config;
  }


  public PluginConfigUIFactory getPluginConfigUIFactory() {
    return new PluginConfigUIFactoryImpl(config,pluginConfigKey);
  }
View Full Code Here

  {
    boolean  handled = false;
   
    for (int i=0;i<listeners.size();i++){
     
      PooledByteBuffer  buffer = new PooledByteBufferImpl(message.getPayload());
     
      try{
        ((GenericMessageConnectionListener)listeners.get(i)).receive( this, buffer );
       
        handled = true;
       
      }catch( Throwable f ){
       
        buffer.returnToPool();
       
        if ( !( f instanceof MessageException )){
       
          Debug.printStackTrace(f);
        }
View Full Code Here

TOP

Related Classes of org.gudy.azureus2.plugins.utils.security.SESecurityManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.