class PGPPipe extends StreamingPipe {

	@Override
	public PipeRunResult doPipe(Message message, IPipeLineSession session) throws PipeRunException {
		try (MessageOutputStream target=getTargetStream(session)) {
			try (OutputStream out = target.asStream()) {
				pgpAction.run(message.asInputStream(), out);
			}
			return target.getPipeRunResult();
		} catch (Exception e) {
			throw new PipeRunException(this, "Exception was thrown during PGPPipe execution.", e);
		}
	}

}