# Encrypt files with PGP

### Description

The `Encrypt files with PGP` action can be used to encrypt and sign files using the GnuPG package.

GnuPG package must be installed in the runtime environment and encryption keys added to the runtime user keystore for this to function.

### Options

#### General tab

| Option                        | Description                                                            |
| ----------------------------- | ---------------------------------------------------------------------- |
| Action name                   | The name of the workflow action.                                       |
| GPG location                  | The file path of the GnuPG executable (e.g. `/usr/bin/gpg`).           |
| Use ASCII mode                | Whether or not to use ASCII mode when encrypting.                      |
| Include subfolders            | Whether or not to include subfolders.                                  |
| Copy previous results to args |                                                                        |
| Action                        | Encrypt, Sign, Sign and Encrypt                                        |
| File/Folder source            | The file to encrypt, can be added to the Files/Folders list using Add. |
| File/Folder destination       | The destination of the encrypted files.                                |
| Wildcard                      | A regex wildcard.                                                      |
| Files/Folders                 | The files to encrypt.                                                  |

#### Destination file tab

| Option                               | Description                                                                                                                                                                         |
| ------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Destination file                     |                                                                                                                                                                                     |
| Create destination folder            | Whether or not to create the destination folder.                                                                                                                                    |
| Destination is a file                | Whether or not the destination is a file.                                                                                                                                           |
| Do not keep folder structure         | Whether or not to keep the folder structure. If unchecked, the folder structure is flattened.                                                                                       |
| Add date to filename                 | Adds the date to the file name.                                                                                                                                                     |
| Add time to filename                 | Adds the time to the file name.                                                                                                                                                     |
| Specify Date time format             | Whether or not to specify the date time format.                                                                                                                                     |
| Date time format                     | The format of the date time.                                                                                                                                                        |
| Add date before extension            | Before or after extension.                                                                                                                                                          |
| If destination file exists           | <ul><li>Do nothing</li><li>Overwrite the destination file</li><li>Create file with unique name</li><li>Delete source file</li><li>Move source file to folder</li><li>Fail</li></ul> |
| Move to folder                       |                                                                                                                                                                                     |
| Destination folder                   | The destination folder.                                                                                                                                                             |
| Create folder                        | Whether or not to create the folder.                                                                                                                                                |
| Add date                             | Adds the date.                                                                                                                                                                      |
| Add time                             | Adds the time.                                                                                                                                                                      |
| Specify format                       | Whether or not to specify the date time format.                                                                                                                                     |
| Add date before extension            | The format of the date time.                                                                                                                                                        |
| If file exists in destination folder | <ul><li>Do nothing</li><li>Overwrite the destination file</li><li>Create file with unique name</li><li>Delete source file</li><li>Move source file to folder</li><li>Fail</li></ul> |

#### Advanced Tab

| Option                         | Description                                                                                                                                                                                       |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Success On                     |                                                                                                                                                                                                   |
| Success condition              | <p>Which condition to validate for a successful run</p><ul><li>Success when all works</li><li>Success when at least x files decrypted</li><li>Success when number of errors lesser than</li></ul> |
| Nr error lesser than           | Success if errors lesser than.                                                                                                                                                                    |
| Result files name              |                                                                                                                                                                                                   |
| Add files to result files name |                                                                                                                                                                                                   |

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.primeur.com/data-shaper-1.21/knowing-the-data-shaper-designer/workflows/actions/pgpencryptfiles.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
