ch.elca.el4j.util.env
Class PropertyEncryptionUtil

java.lang.Object
  extended by ch.elca.el4j.util.env.PropertyEncryptionUtil

public class PropertyEncryptionUtil
extends Object

Utility to load a custom key from file (cryptor.properties). This is in a separate class to make it accessible from Override- and Placeholder-configurer and avoid code duplication.

Author:
David Bernhard (DBD)
File-location:
PropertyEncryptionUtil
Last check-in date:
2009-08-04 15:35:01 +0200 (Di, 04. Aug 2009) by swismer for revision 3883

Field Summary
protected  String m_defaultConfigFile
          The default cryptor configuration file.
 
Constructor Summary
PropertyEncryptionUtil()
          Constructor.
 
Method Summary
 void deactivate()
          Deactivate encryption features.
 AbstractPropertyEncryptor getCryptor()
          Called to get the cryptor object managed by this class.
 void init(ApplicationContext ctx)
          Set up encryption.
 void init(ApplicationContext ctx, String configFile)
           
 boolean isActive()
           
 boolean isInited()
           
 void setSource(PasswordSource source)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_defaultConfigFile

protected String m_defaultConfigFile
The default cryptor configuration file.

Constructor Detail

PropertyEncryptionUtil

public PropertyEncryptionUtil()
Constructor. We cannot do init() here due to the caller not having all properties at construction time.

Method Detail

isInited

public boolean isInited()
Returns:
Whether init() has been called.

isActive

public boolean isActive()
Returns:
Whether we can do encryption.

deactivate

public void deactivate()
Deactivate encryption features.


init

public void init(ApplicationContext ctx)
Set up encryption. We need to pass ctx to access resources.

Parameters:
ctx - ModuleApplicationContext

init

public void init(ApplicationContext ctx,
                 String configFile)
Parameters:
ctx - ModuleApplicationContext
configFile - Custom config file location.

getCryptor

public AbstractPropertyEncryptor getCryptor()
Called to get the cryptor object managed by this class.

Returns:
An initialized cryptor.

setSource

public void setSource(PasswordSource source)
Parameters:
source - A custom PasswordSource


Copyright © 2005-2011 ELCA. All Rights Reserved.