Package nl.nn.adapterframework.pipes
Class PGPPipe
- java.lang.Object
-
- nl.nn.adapterframework.core.TransactionAttributes
-
- nl.nn.adapterframework.pipes.AbstractPipe
-
- nl.nn.adapterframework.pipes.FixedForwardPipe
-
- nl.nn.adapterframework.pipes.PGPPipe
-
- All Implemented Interfaces:
HasTransactionAttribute
,IConfigurable
,IConfigurationAware
,IExtendedPipe
,IForwardTarget
,INamedObject
,IPipe
,IScopeProvider
,EventThrowing
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
@ElementType(TRANSLATOR) public class PGPPipe extends FixedForwardPipe
Performs various PGP (Pretty Good Privacy) actions such as Encrypt, Sign, Decrypt, Verify.
To use this pipe action parameter has to be set to one of the actions above.
Note: When secret key is required in any of the actions, the related public key should also be included in public keys.
Note: For fields that require multiple input (such as recipients, senders and publicKey -in certain actions-) you can seperate multiple values with ";" (semicolon).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PGPPipe.Action
-
Field Summary
-
Fields inherited from class nl.nn.adapterframework.pipes.AbstractPipe
parameterNamesMustBeUnique
-
Fields inherited from class nl.nn.adapterframework.core.TransactionAttributes
log
-
Fields inherited from interface nl.nn.adapterframework.core.IExtendedPipe
LONG_DURATION_MONITORING_EVENT, MESSAGE_SIZE_MONITORING_EVENT, PIPE_EXCEPTION_MONITORING_EVENT
-
-
Constructor Summary
Constructors Constructor Description PGPPipe()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure()
checks for correct configuration of forwardPipeRunResult
doPipe(Message message, PipeLineSession session)
This is where the action takes place.void
setAction(PGPPipe.Action action)
Action to be taken when pipe is executed.void
setPublicKeys(String publicKeys)
Path to the recipient's public key.void
setRecipients(String recipients)
Recipients to be used during encryption stage.void
setSecretKey(String secretKey)
Path to the private key.void
setSecretPassword(String secretPassword)
Password for the private key.void
setVerificationAddresses(String verificationAddresses)
Emails of the senders.-
Methods inherited from class nl.nn.adapterframework.pipes.FixedForwardPipe
getIfParam, getIfValue, getOnlyIfSessionKey, getOnlyIfValue, getParameterValue, getSuccessForward, getUnlessSessionKey, getUnlessValue, isSkipOnEmptyInput, setIfParam, setIfValue, setOnlyIfSessionKey, setOnlyIfValue, setSkipOnEmptyInput, setUnlessSessionKey, setUnlessValue, skipPipe
-
Methods inherited from class nl.nn.adapterframework.pipes.AbstractPipe
addParameter, consumesSessionVariable, createBean, findForward, getAdapter, getApplicationContext, getChompCharSize, getConfigurationClassLoader, getDurationThreshold, getElementToMove, getElementToMoveChain, getElementToMoveSessionKey, getEmptyInputReplacement, getEventSourceName, getForwards, getGetInputFromFixedValue, getGetInputFromSessionKey, getHideRegex, getInSizeStatDummyObject, getLocker, getLogIntermediaryResults, getMaxThreads, getName, getOutSizeStatDummyObject, getParameterList, getPipeLine, getSecLogSessionKeys, getStoreResultInSessionKey, hasSizeStatistics, isPreserveInput, isRemoveCompactMsgNamespaces, isRestoreMovedElements, isWriteToSecLog, registerEvent, registerForward, setApplicationContext, setChompCharSize, setDurationThreshold, setElementToMove, setElementToMoveChain, setElementToMoveSessionKey, setEmptyInputReplacement, setEventPublisher, setGetInputFromFixedValue, setGetInputFromSessionKey, setHideRegex, setLocker, setLogIntermediaryResults, setMaxThreads, setName, setPipeLine, setPreserveInput, setRemoveCompactMsgNamespaces, setRestoreMovedElements, setSecLogSessionKeys, setSizeStatistics, setStoreResultInSessionKey, setWriteToSecLog, start, stop, throwEvent
-
Methods inherited from class nl.nn.adapterframework.core.TransactionAttributes
configureTransactionAttributes, getTransactionAttribute, getTransactionTimeout, getTxDef, isTransacted, isTransacted, setTransacted, setTransactionAttribute, setTransactionTimeout
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface nl.nn.adapterframework.core.IExtendedPipe
throwEvent
-
-
-
-
Method Detail
-
configure
public void configure() throws ConfigurationException
Description copied from class:FixedForwardPipe
checks for correct configuration of forward- Specified by:
configure
in interfaceIConfigurable
- Specified by:
configure
in interfaceIPipe
- Overrides:
configure
in classFixedForwardPipe
- Throws:
ConfigurationException
-
doPipe
public PipeRunResult doPipe(Message message, PipeLineSession session) throws PipeRunException
Description copied from interface:IPipe
This is where the action takes place. Pipes may only throw a PipeRunException, to be handled by the caller of this object. Implementations must either consume the message, or pass it on to the next Pipe in the PipeRunResult. If the result of the Pipe does not depend on the input, like for theFixedResultPipe
, the Pipe can schedule the input to be closed at session exit, by callingMessage.closeOnCloseOf(PipeLineSession, String)
This allows the previous Pipe to release any resources (e.g. connections) that it might have kept open until the message was consumed. Doing so avoids connections leaking from pools, while it enables efficient streaming processing of data while it is being read from a stream.- Throws:
PipeRunException
-
setAction
public void setAction(PGPPipe.Action action)
Action to be taken when pipe is executed.
-
setRecipients
public void setRecipients(String recipients)
Recipients to be used during encryption stage. If multiple, separate with ';' (semicolon)
-
setVerificationAddresses
public void setVerificationAddresses(String verificationAddresses)
Emails of the senders. This will be used to verify that all the senders have signed the given message. If not set, and the action is verify; this pipe will validate that at least one person has signed. For signing action, it needs to be set to the email that was used to generate the private key "that is being used for this process.
-
setSecretKey
public void setSecretKey(String secretKey)
Path to the private key. It will be used when signing or decrypting.
-
setSecretPassword
public void setSecretPassword(String secretPassword)
Password for the private key.
-
setPublicKeys
public void setPublicKeys(String publicKeys)
Path to the recipient's public key. It will be used for encryption and verification.
-
-