|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectatg.nucleus.GenericService
com.digitalsanctuary.atg.crypto.AbstractEncryptorComponent
This is an abstract class of an encryptor component.
Field Summary |
Fields inherited from class atg.nucleus.GenericService |
CLASS_VERSION, SERVICE_INFO_KEY |
Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
Constructor Summary | |
AbstractEncryptorComponent()
|
Method Summary | |
java.lang.String |
computeMAC(java.lang.String pClearText)
This method computes the MAC message signature for the clear text. |
byte[] |
decryptBytes(byte[] pBytesToDecrypt)
This method takes in a byte array and decrypts it using the AES algorithm and the key used to setup this class. |
java.lang.String |
decryptString(java.lang.String pEncryptedContent)
This method takes in a String of a Base64 encoded byte array of encrypted data and decrypts it using the AES algorithm and the key used to setup this class. |
void |
doStartService()
This method sets up our component, and creates the Encryptor object. |
byte[] |
encryptBytes(byte[] pBytesToEncrypt)
This method takes in a byte array and encrypts it using the AES algorithm and the key used to setup this class. |
java.lang.String |
encryptString(java.lang.String pUnencryptedContent)
This method takes in a String and encrypts is using the AES algorithm and the key used to setup this class. |
AbstractEncryptor |
getEncryptor()
|
java.lang.String |
getKey()
|
void |
setEncryptor(AbstractEncryptor pEncryptor)
|
void |
setKey(java.lang.String pKey)
|
abstract void |
setupEncryptor()
This method sets up the encryptor. |
Methods inherited from class atg.nucleus.GenericService |
addLogListener, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingWarning, setServiceInfo, startService, stopService |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AbstractEncryptorComponent()
Method Detail |
public java.lang.String computeMAC(java.lang.String pClearText) throws EncryptorException
pClearText
- the plain text you wish to compute the MAC for. This must match the plain text you encrypt.
EncryptorException
- if the key is invalid, if the algorithm is improperly defined, or if the encoding fails.public byte[] decryptBytes(byte[] pBytesToDecrypt) throws EncryptorException
pBytesToDecrypt
- the byte array to be decrypted using AES and the key in mKeyBytes.
EncryptorException
- if decryption fails.public java.lang.String decryptString(java.lang.String pEncryptedContent) throws EncryptorException
pEncryptedContent
- the String of encoded and encrypted content which should be decrypted.
EncryptorException
- if decryption fails.public void doStartService() throws atg.nucleus.ServiceException
atg.nucleus.ServiceException
- if key is nullGenericService.doStartService()
public abstract void setupEncryptor() throws EncryptorException
EncryptorException
- if the encryptor could not be createdpublic byte[] encryptBytes(byte[] pBytesToEncrypt) throws EncryptorException
pBytesToEncrypt
- the byte array to be encrypted using AES and the key in mKeyBytes
EncryptorException
- if encryption fails.public java.lang.String encryptString(java.lang.String pUnencryptedContent) throws EncryptorException
pUnencryptedContent
- the String to be encrypted using AES and the key in mKey.
EncryptorException
- if encryption fails.public java.lang.String getKey()
public void setKey(java.lang.String pKey)
pKey
- The key to set.public AbstractEncryptor getEncryptor()
public void setEncryptor(AbstractEncryptor pEncryptor)
pEncryptor
- the encryptor to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |