|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jcorporate.expresso.kernel.ComponentBase
com.jcorporate.expresso.core.security.CryptoManager
CryptoManager.java
Singleton Class that acts as a facade for managing if strong or weak crypto is desired. Copyright 2000-2002 Jcorporate Ltd.
| Field Summary | |
protected static ByteArrayCounter |
ivCounter
|
protected AbstractRandomNumber |
randomGenerator
|
protected AbstractStringEncryption |
stringEncryptor
|
protected StringHash |
stringHash
|
| Constructor Summary | |
CryptoManager()
Do not call this constructor directly. |
|
| Method Summary | |
void |
configure(Configuration newConfig)
Configure the Cryptographic manager |
void |
destroy()
Method removes all static entries. |
String |
getCryptoKey()
|
String |
getEncryptMode()
|
static CryptoManager |
getInstance()
Singleton Generator. |
AbstractRandomNumber |
getRandomGenerator()
Returns an instantiated subclass of AbstractRandomNumber depending if strong or weak crypto is desired. |
String |
getRandomSeed()
|
AbstractStringEncryption |
getStringEncryption()
Factory method that returns an instantiated subclass of AbstractStringEncryption depending of strong
or weak crypto is desired. |
StringHash |
getStringHash()
Factory method that returns an instantiated subclass of AbstractStringHash depending of strong
or weak crypto is desired. |
void |
initialize()
Initialize the component, this is called before the component receives any configuration information. |
boolean |
isInitialized()
|
boolean |
isStrongCrypto()
|
boolean |
isUsingStrongCrypto()
Returns whether the crypto manager is using strong cryptography or not. |
void |
loadClasses(boolean useStrongCrypto)
Loads the appropriate crypto classes. |
void |
reconfigure(Configuration newConfig)
Reconfigure lifecycle event. |
void |
setCryptoKey(String cryptoKey)
|
void |
setEncryptMode(String encryptMode)
|
void |
setRandomSeed(String randomSeed)
|
void |
setStrongCrypto(boolean strongCrypto)
|
| Methods inherited from class com.jcorporate.expresso.kernel.ComponentBase |
getMetaData, getMetadataLocation, getParent, setMetaData, setParent |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static ByteArrayCounter ivCounter
protected AbstractRandomNumber randomGenerator
protected AbstractStringEncryption stringEncryptor
protected StringHash stringHash
| Constructor Detail |
public CryptoManager()
| Method Detail |
public static CryptoManager getInstance()
throws ChainedException
Please Note If strong encryption is used, this class may take quite some time in initializing due to the nature of generating a default seed for the crypto-strength random number generator.
ChainedException - If there is a problem instantiating the crypto classespublic void destroy()
destroy in interface ComponentLifecyclepublic boolean isUsingStrongCrypto()
public AbstractRandomNumber getRandomGenerator()
AbstractRandomNumber,
RandomNumber,
RandomNumberpublic AbstractStringEncryption getStringEncryption()
AbstractStringEncryption depending of strong
or weak crypto is desired.
AbstractStringEncryption,
StringEncryption,
StringEncryptionpublic StringHash getStringHash()
AbstractStringHash depending of strong
or weak crypto is desired.
StringHash
public void loadClasses(boolean useStrongCrypto)
throws ChainedException
useStrongCrypto - Set to true if we desire to load the strong
cryptographic classes.
ChainedException - upon error loading the classes.public void initialize()
ComponentLifecycle
initialize in interface ComponentLifecycle
public void configure(Configuration newConfig)
throws ConfigurationException
configure in interface ComponentLifecyclenewConfig - the new configuration bean to configure with
ConfigurationException - upon configuration error
public void reconfigure(Configuration newConfig)
throws ConfigurationException
reconfigure in interface ComponentLifecyclenewConfig - the configuration data to reconfigure with.
ConfigurationException - if for some reason the Component cannot cope
with the configuration sent to it. If this exception is thrown then ZERO
reconfiguration takes place. Configure() must be an all or nothing 'transaction'public boolean isStrongCrypto()
public void setStrongCrypto(boolean strongCrypto)
public String getEncryptMode()
public void setEncryptMode(String encryptMode)
public boolean isInitialized()
public void setCryptoKey(String cryptoKey)
public String getCryptoKey()
public void setRandomSeed(String randomSeed)
public String getRandomSeed()
|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||