Examples of CryptoHandler


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

Examples of de.esoco.microsafe.crypto.CryptoHandler

   * @throws UserNotificationException If an error occurs
   */
  void changeNodeEncryption(final MicroSafeNode rNode)
    throws UserNotificationException
  {
    CryptoHandler rCrypto  = rNode.getCryptoHandler();
    final boolean bEncrypt = !rNode.isEncrypted();

    if (rCrypto == null)
    {
      boolean bNewEncryption = !rModel.usesEncryption();
View Full Code Here

Examples of de.esoco.microsafe.crypto.CryptoHandler

   *
   * @throws UserNotificationException If an error occurs
   */
  void changePassword() throws UserNotificationException
  {
    CryptoHandler rCrypto = rModel.getCryptoHandler();

    if (rModel.usesEncryption() && rCrypto == null)
    {
      Executable aNewPwQuery = new Executable()
      {
View Full Code Here

Examples of de.esoco.microsafe.crypto.CryptoHandler

   * @throws CryptoException  If enabling or disabling the encryption fails
   */
  public void setEncryption(boolean bEncrypt) throws CryptoException,
                             StorageException
  {
    CryptoHandler aCrypto = getCryptoHandler();

    if (aCrypto != null)
    {
      if (bEncrypt)
      {
View Full Code Here

Examples of de.esoco.microsafe.crypto.CryptoHandler

   * @throws CryptoException  If changing the encryption fails
   */
  protected void changeEncryption(CryptoHandler rNewCrypto)
    throws CryptoException, StorageException
  {
    CryptoHandler rCurrentCrypto = getCryptoHandler();

    if (((rNewCrypto == null) && (rCurrentCrypto != null)) ||
      ((rNewCrypto != null) && !rNewCrypto.equals(rCurrentCrypto)))
    {
      // re-encryption is only necessary if nodes are already encrypted
View Full Code Here

Examples of de.esoco.microsafe.crypto.CryptoHandler

   */
  public void setEncryptionKey(byte[] rKey) throws InvalidKeyException,
                           CryptoException,
                           StorageException
  {
    CryptoHandler aNewCrypto = null;

    if (rKey != null)
    {
      aNewCrypto = new CryptoHandler(rKey);
      aNewCrypto.setProgressMonitor(rProgressMonitor);
    }

    if (((aNewCrypto == null) && (aCryptoHandler != null)) ||
      ((aNewCrypto != null) && !aNewCrypto.equals(aCryptoHandler)))
    {
      if ((aCryptoHandler == null) && (aKeyVerificationData != null))
      {
        verifyKey(aNewCrypto);

        return;
      }

      changeEncryption(aNewCrypto);

      // generate key verification data for the new key or reset it
      if (aNewCrypto != null)
      {
        aKeyVerificationData = aNewCrypto.generateKeyVerification(KEY_VERIFY_ITERATIONS);
      }
      else
      {
        aKeyVerificationData = null;
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.