A sample demonstrates the PGP Encryption/Decryption in pipelines.
You can download a code here.
A sample is based on a sample by Brian Jones See original code here
The main additions to original code:
Single pipeline component was separated to two Encrypt and Decrypt pipeline components. It simplifies the pipeline configurations.
Configuration parameters are stored in SSO, which, I hope, improves security.
File names for temporary files are regenerated randomly each time. That eliminates errors in case when temporary file names are based on the inbound file names and pipelines are working simultaneously in several ports.
To build pipeline components you have to download a BouncyCastle.Crypto.dll assembly from
The solution includes two pairs of the PGP keys. You can generate yours pairs using, for example, PortablePGP utility
Configuration includes a config file for a SSO Config Store utility created by Richard Seroter.
The test pipeline project includes four pipelines:
Send and Receive pipelines for Encryption
Send and Receive pipelines for Decryption.
To test these pipelines I’ve created four receive ports and four send ports. They create four test workflows:
Encryption on a Receive port:
RP::GLD.Samples.Pipelines.Encrypt.Encode ( PgpEncryptReceive pipeline )
Encryption on a Send port:
SP:: GLD.Samples.Pipelines.Encrypt.Encode ( PgpEncryptSend pipeline )
Decryption on a Receive port:
RP:: GLD.Samples.Pipelines.Decrypt.Decode ( PgpDecryptReceive pipeline )
Decryption on a Send port:
SP:: GLD.Samples.Pipelines.Decrypt.Decrypt ( PgpDecryptSend pipeline )
To test pipelines:
Use test text files in a Tests\TestData folder
To test encryption:
Copy test files to a Tests\Encrypt\In folder
Encrypted files are created in a Test\Encrypt\Out folder.
To test decryption:
Copy test encrypted files from a Test\Encrypt\Out folder to a Tests\Decrypt\In folder
Decrypted files are created in a Test\Decrypt\Out folder.