PGP Encrypt Stage
The PGP Encrypt stage allows messages to be PGP encrypted.
Stage Overview
The PGP Encrypt stage allows messages to be PGP encrypted.
Stage Definition File Location
All PGP Encrypt stages are defined by creating an appropriately formatted JSON definition file in the following location:
Stage JSON Definition File Format
The JSON definition file for a PGP Encrypt stage is as follows:
{
"name": "stage-name",
"displayName": "Brief Stage Title",
"description": "Brief description of the stage.",
"enabled": "$env:STATUS_<INTEGRATION_NAME>",
"source": "source-event",
"publicKeySecretName": "$env:PGP_PUBLIC_KEY",
"privateKeySecretName": "$env:PGP_PRIVATE_KEY",
"passPhraseSecretName": "$env:PGP_PRIVATE_KEY_PASSPHRASE",
"preLogTransformSchemaFileName": "schemas/path/to/schema/schema-name.liquid",
"preLogTransformSchemaType": "liquid|javascript",
"preLogTransformFormat": "json|xml|csv"
}
| Property | Description |
|---|---|
name | The name of the stage. |
displayName | Optional (but highly recommended). A short (3 or 4 word) "display name" for the stage, used as a "title" of the stage in the Integration Hub Portal service's self-documentation capability. |
description | Optional (but highly recommended). A brief (10 to 15 word) description of the stage, used as a brief description of the stage's purpose in the Integration Hub Portal service's self-documentation capability. For a more detailed explanation (when needed), use the stage markdown feature. |
enabled | Optional boolean flag (true or false). Default is true. Generally set via a DevOps variable. Controls if the stage is deployed enabled or not. |
source | The source event that the stage subscribes to. See Pub/Sub Model. Alternatively, sources may be supplied, and an array of one or more source events can be subscribed to. |
publicKeySecretName | The PGP public key. An $env: token for an Azure DevOps variable, or a $kv: token for a Key Vault secret, that holds the key. See Stage Secrets.The PGP public key will be used to encrypt the payload. Typically, the PGP public key will be the PGP public key of a remote service that messages are being sent to; this means the PGP public key will not typically match the PGP private key and passphrase below. The PGP public key needs to be Base64 encoded. |
privateKeySecretName | The PGP private key. An $env: token for an Azure DevOps variable, or a $kv: token for a Key Vault secret, that holds the key.The PGP private key (and passphrase below) will be used to sign the encrypted payload. Typically, the PGP private key will be "your" PGP private key (and passphrase below), so that encrypted messages sent to a remote service can use "your" PGP public key to validate the messages are from "you" before decrypting them; this means the PGP private key (and passphrase below) will not typically match the PGP public key above. The PGP private key needs to be Base64 encoded. |
passPhraseSecretName | The PGP private key passphrase. An $env: token for an Azure DevOps variable, or a $kv: token for a Key Vault secret, that holds the passphrase.The PGP private key passphrase must be the correct passphrase for the PGP private key (above). The PGP private key passphrase needs to be Base64 encoded. |
Pre-Logging Transformation
This stage supports the optional pre-logging transformation feature using the following fields:
preLogTransformSchemaFileNamepreLogTransformSchemaTypepreLogTransformFormat
See the Pre-Logging Transformation for details.
PGP Secret Formats
The publicKeySecretName and privateKeySecretName values (the Azure DevOps variable values, or the Key Vault secret values) must be Base64 encoded versions of the PGP public and private keys.
The passPhraseSecretName value must be a Base64 encoded version of the PGP private key passphrase.
An Azure DevOps variable can hold a maximum of 4,096 characters. The Base64 encoded value of an RSA PGP key is longer than this, for example about 9,000 characters for an RSA 4096 private key. For RSA keys, use a $kv: token for a Key Vault secret. See Stage Secrets.
The PGP public key is expected to start and end with begin/end comments:
-----BEGIN PGP PUBLIC KEY BLOCK-----
// Public key contents in here...
-----END PGP PUBLIC KEY BLOCK-----
It is this content that should be Base64 encoded, and used as the publicKeySecretName value.
Similarly, the PGP private key is expected to start and end with begin/end comments:
-----BEGIN PGP PRIVATE KEY BLOCK-----
// Private key contents in here...
-----END PGP PRIVATE KEY BLOCK-----
It is this content that should be Base64 encoded, and used as the privateKeySecretName value.
Last updated on