+ "'. Expected instance of '"
+ CloudloopConfig.class.getName( ) + "'." );
}
}
ConfigurationWorkflowElementOutput output = new ConfigurationWorkflowElementOutput( );
printEncryptionWarning( writer );
CloudloopConfig config = (CloudloopConfig) input;
boolean alreadyConfigured = ( config.getEncryption( ) != null );
boolean done = false;
while ( !done )
{
if ( !alreadyConfigured )
{
boolean yOrN = ConfigFrameUtil
.readYorN(
"Would you like to use Cloudloop's default encryption configuration?\n"
+ "If you choose this option, a key will be generated for you and your data will "
+ "be encrypted using 128-bit AES encryption. (Y/N)? ",
writer, reader, error );
if ( yOrN )
{
setupDefaultEncryption( config );
}
else
{
doManualSetup( writer, reader, error, output );
}
}
else
{
doManualSetup( config, writer, reader, error, output );
}
writer
.println( "Testing your encryption configuration. This could take a few seconds..." );
writer.flush( );
if ( !testEncryption( error ) )
{
writer.println( "Encryption configuration test failed." );
writer.flush( );
boolean yOrN = ConfigFrameUtil
.readYorN(
"Would you like to try a different configuration? (Y/N) ",
writer, reader, error );
if ( !yOrN )
{
output.quit( );
}
else
{
done = false;
continue;
}
}
writer.println( "Encryption configuration succesfully tested." );
writer.flush( );
done = true;
}
if ( !output.goBack( ) && !output.quit( ) )
{
Encryption newEncryption = new Encryption( );
newEncryption.setCipher( _cipher );
newEncryption.setKeyLength( _keyLen );
newEncryption.setKeyDirectory( _keyDir.getAbsolutePath( ) );