Package com.cloudloop.generated.CloudloopConfig

Examples of com.cloudloop.generated.CloudloopConfig.Encryption


      localProps.add( prop );
  }
  localProps.add( localRoot );
  storeList.add( localStore );
 
  Encryption encryption = new Encryption( );
  encryption.setCipher( EncryptionUtil.DEFAULT_CIPHER );
  File currDir = new File( "./test-keys/" );
  FileUtil.mkdir( currDir );
  encryption.setKeyDirectory( currDir.getAbsolutePath( ) );
  encryption.setKeyLength( 128 );
  File keyFile = new File( currDir, TimeUtil.getConciseTimestamp( )
    + ".key" );
  EncryptionUtil
    .generateKey( EncryptionUtil.DEFAULT_CIPHER, 128, keyFile );
  encryption.setPreferredKey( keyFile.getName( ) );
  config.setEncryption( encryption );
 
  return config;
    }
View Full Code Here


   
    private void setupEncryption( CloudloopConfig config )
      throws  InvalidConfigurationException,
          IOException
    {
      Encryption encryptionConfig = config.getEncryption( );
      if ( encryptionConfig == null )
      {
        // Encryption not configured. Return...
        return;
      }
     
    File keyDirectory = new File( encryptionConfig.getKeyDirectory( ) );
      if ( !keyDirectory.exists( ) || !keyDirectory.isDirectory( ) )
      {
      throw new InvalidConfigurationException(
        "Could not find encryption key directory '"
        + keyDirectory.getAbsolutePath( ) + "'." );
      }
     
      try
      {
      _encryptionProvider = EncryptionProviderBuilder
        .buildProvider( keyDirectory, encryptionConfig.getPreferredKey( ) );
      }
      catch ( NoSuchAlgorithmException e )
      {
        throw new InvalidConfigurationException( e );
      }
View Full Code Here

      done = true;
  }
 
  if ( !output.goBack( ) && !output.quit( ) )
  {
      Encryption newEncryption = new Encryption( );
      newEncryption.setCipher( _cipher );
      newEncryption.setKeyLength( _keyLen );
      newEncryption.setKeyDirectory( _keyDir.getAbsolutePath( ) );
      newEncryption.setPreferredKey( _preferredKey.getName( ) );
      config.setEncryption( newEncryption );
  }
 
  return output;
    }
View Full Code Here

TOP

Related Classes of com.cloudloop.generated.CloudloopConfig.Encryption

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.