@ComponentProfile(summary="Encrypts or Decrypts payload using key and initial vector", tag="service,cryptography") public class SymmetricKeyCryptographyService extends ServiceImp
In the adapter configuration file this class is aliased as symmetric-key-cryptography-service which is the preferred alternative to the fully qualified classname when building your configuration.
Modifier and Type | Class and Description |
---|---|
static class |
SymmetricKeyCryptographyService.OpMode |
log
CONFIRMATION_ID_KEY
Constructor and Description |
---|
SymmetricKeyCryptographyService() |
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsConfirmation, getIsTrackingEndpoint, getLookupName, getUniqueId, init, isBranching, isConfirmation, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, rethrowServiceException, retrieveComponentState, setContinueOnFail, setIsConfirmation, setIsTrackingEndpoint, setLookupName, setUniqueId, start, stop
public void doService(AdaptrisMessage msg) throws ServiceException
Service
Apply the service to the message.
msg
- the AdaptrisMessage
to processServiceException
- wrapping any underlying Exception
sprotected void initService() throws CoreException
initService
in class ServiceImp
CoreException
protected void closeService()
closeService
in class ServiceImp
public void prepare() throws CoreException
ComponentLifecycleExtension
CoreException
public void setAlgorithm(java.lang.String algorithm)
algorithm
- the name of the secret-key algorithm to be associated with the given key.public java.lang.String getAlgorithm()
public SymmetricKeyCryptographyService withAlgorithm(java.lang.String algorithm)
public void setCipherTransformation(java.lang.String cipherTransformation)
cipherTransformation
- the name of the transformation, e.g., AES/CBC/PKCS5Padding.public java.lang.String getCipherTransformation()
public SymmetricKeyCryptographyService withCipherTransformation(java.lang.String cipherTransformation)
public void setInitialVector(DataInputParameter<java.lang.String> initialVector)
initialVector
- Base64 encoded string of initial vector bytes.public DataInputParameter<java.lang.String> getInitialVector()
public SymmetricKeyCryptographyService withInitialVector(DataInputParameter<java.lang.String> initialVector)
public void setKey(DataInputParameter<java.lang.String> key)
key
- Base64 encoded string of key bytes.public DataInputParameter<java.lang.String> getKey()
public SymmetricKeyCryptographyService withKey(DataInputParameter<java.lang.String> key)
public void setOperationMode(SymmetricKeyCryptographyService.OpMode mode)
mode
- the operation mode of the cipher: ENCRYPT or DECRYPT (default: DECRYPT)public SymmetricKeyCryptographyService.OpMode getOperationMode()