Class EncryptDecrypt
- java.lang.Object
-
- com.adaptris.core.ServiceImp
-
- com.adaptris.aws.kms.AWSKMSServiceImpl
-
- com.adaptris.aws.kms.EncryptDecrypt
-
- All Implemented Interfaces:
AdaptrisComponent,ComponentLifecycle,ComponentLifecycleExtension,ConnectedService,MessageEventGenerator,Service,StateManagedComponent
- Direct Known Subclasses:
DecryptService,EncryptService
public abstract class EncryptDecrypt extends AWSKMSServiceImpl
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.ServiceImp
log
-
-
Constructor Summary
Constructors Constructor Description EncryptDecrypt()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringencryptionAlgorithm(AdaptrisMessage msg)protected java.util.Map<java.lang.String,java.lang.String>encryptionContext()java.lang.StringgetEncryptionAlgorithm()Specify the encryption algorithm to use for this operation.KeyValuePairSetgetEncryptionContext()Specify an encryption context values that you want to use.MessageWrapper<byte[]>getInput()Specify the source for the encrypt/decrypt operation.MessageWrapper<java.io.OutputStream>getOutput()Specify the message type for this operation.voidsetEncryptionAlgorithm(java.lang.String encryptionAlgorithm)Specify the encryption algorithm to use for this operation.voidsetEncryptionContext(KeyValuePairSet encryptionContext)Specify an encryption context values that you want to use.voidsetInput(MessageWrapper<byte[]> input)Specify the source for the encrypt/decrypt operation.voidsetOutput(MessageWrapper<java.io.OutputStream> output)Specify the message type for this operation.protected java.nio.ByteBuffertoByteBuffer(AdaptrisMessage msg)<T extends EncryptDecrypt>
TwithEncryptionAlgorithm(java.lang.String s)<T extends EncryptDecrypt>
TwithEncryptionContext(KeyValuePairSet ctx)<T extends EncryptDecrypt>
TwithInput(MessageWrapper<byte[]> in)<T extends EncryptDecrypt>
TwithOutput(MessageWrapper<java.io.OutputStream> out)protected voidwriteOutput(java.nio.ByteBuffer data, AdaptrisMessage msg)-
Methods inherited from class com.adaptris.aws.kms.AWSKMSServiceImpl
awsClient, closeService, getConnection, getKeyId, initService, prepare, setConnection, setKeyId, start, stop, withConnection, withKeyId
-
Methods inherited from class com.adaptris.core.ServiceImp
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setUniqueId
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.adaptris.core.AdaptrisComponent
getUniqueId
-
Methods inherited from interface com.adaptris.core.ComponentLifecycle
close, init
-
Methods inherited from interface com.adaptris.core.MessageEventGenerator
createName, createQualifier, isTrackingEndpoint
-
Methods inherited from interface com.adaptris.core.Service
continueOnFailure, doService, isBranching, setUniqueId
-
Methods inherited from interface com.adaptris.core.StateManagedComponent
changeState, requestClose, requestInit, requestStart, requestStop, retrieveComponentState
-
-
-
-
Method Detail
-
withInput
public <T extends EncryptDecrypt> T withInput(MessageWrapper<byte[]> in)
-
withOutput
public <T extends EncryptDecrypt> T withOutput(MessageWrapper<java.io.OutputStream> out)
-
withEncryptionContext
public <T extends EncryptDecrypt> T withEncryptionContext(KeyValuePairSet ctx)
-
withEncryptionAlgorithm
public <T extends EncryptDecrypt> T withEncryptionAlgorithm(java.lang.String s)
-
encryptionContext
protected java.util.Map<java.lang.String,java.lang.String> encryptionContext()
-
encryptionAlgorithm
protected java.lang.String encryptionAlgorithm(AdaptrisMessage msg)
-
writeOutput
protected void writeOutput(java.nio.ByteBuffer data, AdaptrisMessage msg) throws java.lang.Exception- Throws:
java.lang.Exception
-
toByteBuffer
protected java.nio.ByteBuffer toByteBuffer(AdaptrisMessage msg) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getInput
public MessageWrapper<byte[]> getInput()
Specify the source for the encrypt/decrypt operation.Since KMS encrypt/decrypt API uses
ByteBufferwe use aMessageWrapperthat wraps a byte array; this will mean that the entire contents of the message payload will ultimately be resident in memory.
-
setInput
public void setInput(MessageWrapper<byte[]> input)
Specify the source for the encrypt/decrypt operation.Since KMS encrypt/decrypt API uses
ByteBufferwe use aMessageWrapperthat wraps a byte array; this will mean that the entire contents of the message payload will ultimately be resident in memory.
-
getOutput
public MessageWrapper<java.io.OutputStream> getOutput()
Specify the message type for this operation.Since KMS encrypt/decrypt API uses
ByteBufferwe use aMessageWrapperthat wraps an Outputstream
-
setOutput
public void setOutput(MessageWrapper<java.io.OutputStream> output)
Specify the message type for this operation.Since KMS encrypt/decrypt API uses
ByteBufferwe use aMessageWrapperthat wraps an Outputstream
-
getEncryptionContext
public KeyValuePairSet getEncryptionContext()
Specify an encryption context values that you want to use.
-
setEncryptionContext
public void setEncryptionContext(KeyValuePairSet encryptionContext)
Specify an encryption context values that you want to use.
-
getEncryptionAlgorithm
public java.lang.String getEncryptionAlgorithm()
Specify the encryption algorithm to use for this operation.No validation is done on the value; if this is not set then behaviour will largely be dependent on the key in question, if it is a symmetric key then
SYMMETRIC_DEFAULTwill be used, if it is an asymmetric CMK then it's likely be an exception.
-
setEncryptionAlgorithm
public void setEncryptionAlgorithm(java.lang.String encryptionAlgorithm)
Specify the encryption algorithm to use for this operation.No validation is done on the value; if this is not set then behaviour will largely be dependent on the key in question, if it is a symmetric key then
SYMMETRIC_DEFAULTwill be used, if it is an asymmetric CMK then it's likely be an exception.
-
-