Package com.aelitis.azureus.core.security

Examples of com.aelitis.azureus.core.security.CryptoHandler


            passwordDetails   details)
          {
          }
        });
     
      CryptoHandler  handler1 = man.getECCHandler();
     
      CryptoHandler  handler2 = new CryptoHandlerECC( man, 2 );
     

      // handler1.resetKeys( null );
      // handler2.resetKeys( null );
     
      byte[]  sig = handler1.sign( stuff.getBytes(), "h1: sign" );
     
      System.out.println( handler1.verify( handler1.getPublicKey"h1: Test verify" ), stuff.getBytes(), sig ));
     
      handler1.lock();
     
      byte[]  enc = handler1.encrypt( handler2.getPublicKey( "h2: getPublic" ), stuff.getBytes(), "h1: encrypt" );
     
      System.out.println( "pk1 = " + ByteFormatter.encodeString( handler1.getPublicKey("h1: getPublic")));
      System.out.println( "pk2 = " + ByteFormatter.encodeString( handler2.getPublicKey("h2: getPublic")));
     
      System.out.println( "dec: " + new String( handler2.decrypt(handler1.getPublicKey( "h1: getPublic" ), enc, "h2: decrypt" )));
     
    }catch( Throwable e ){
     
      e.printStackTrace();
    }
View Full Code Here

TOP

Related Classes of com.aelitis.azureus.core.security.CryptoHandler

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.