PGP Encrypt Action
Provided by: "Apache Software Foundation"
Support Level for this Kamelet is: "Preview"
Encrypts the body of each message with OpenPGP for the public key of a recipient, and can also sign it, as GnuPG (gpg) does.
Use it to encrypt a file before you send it to a partner, for example with sftp-sink, ftp-sink or aws-s3-sink, when the partner gave you their public key. The partner decrypts it with gpg, or with pgp-decrypt-action.
Input: any body: text, bytes, a stream or a file.
Output: the body is the OpenPGP message, as a stream: binary, or ASCII text that starts with -----BEGIN PGP MESSAGE----- when armored is true. The Content-Type header is set to application/pgp-encrypted. The other headers are kept.
Good to know: the data is compressed, encrypted with AES-256 and protected against changes. When signingKeyRing is set, the message is also signed with your secret key, with SHA-256, so the recipient can check that it comes from you. The keys and the passphrase come only from the options: the headers of the message, such as CamelPGPDataFormatKeyUserid, are removed first, so a message cannot choose another key. The file name in the CamelFileName header, which file sources set, is stored in the message. A key ring that cannot be read, or a keyUserId that matches no key, fails each message. When signingKeyRing is set without signingKeyUserId or signingPassphrase, the Kamelet does not start.
Configuration Options
The following table summarizes the configuration options available for the pgp-encrypt-action Kamelet:
| Property | Name | Description | Type | Default | Example |
|---|---|---|---|---|---|
Key User ID | Required Which key of the key ring to encrypt for: its user id, such as | string | files@partner.example.com// | ||
Public Key Ring | Required Where to load the public key ring of the recipient from: | string | file:/etc/keys/partner-public.gpg | ||
Armored | Whether to write the message as ASCII text (armored), which fits where only text is allowed, such as an email or a JSON field, instead of binary. Armored text is about a third larger. | boolean | false | ||
Signing Key Ring | Where to load your secret key ring from, to sign the message: | string | file:/etc/keys/my-secret.gpg | ||
Signing Key User ID | Which key of | string | exports@mycompany.example.com// | ||
Signing Passphrase | The passphrase of the secret key to sign with. Required when | string |
Dependencies
At runtime, the pgp-encrypt-action Kamelet relies upon the presence of the following dependencies:
-
camel:kamelet
-
camel:crypto-pgp
Camel JBang usage
Prerequisites
-
You’ve installed JBang.
-
You have executed the following command:
jbang app install camel@apache/camel Supposing you have a file named route.yaml with this content:
- route:
from:
uri: "kamelet:timer-source"
parameters:
period: 10000
message: 'test'
steps:
- to:
uri: "kamelet:pgp-encrypt-action"
parameters:
.
.
.
- to:
uri: "kamelet:log-sink" You can now run it directly through the following command
camel run route.yaml