////
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at
  http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
////
:documentationPath: /workflow/actions/
:language: en_US
:description: The Encrypt Files With PGP action can be used to encrypt and sign files.

= 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

[options="header", width="90%", cols="1,3"]
|===
|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.
// |User ID|User ID of the key in the runtime user keystore
|Files/Folders|The files to encrypt.
|===

=== Destination file tab

[options="header", width="90%", cols="1,3"]
|===
|Option|Description
2+|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 a|

* Do nothing
* Overwrite the destination file
* Create file with unique name
* Delete source file
* Move source file to folder
* Fail

2+|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 a|

* Do nothing
* Overwrite the destination file
* Create file with unique name
* Delete source file
* Move source file to folder
* Fail
|===

=== Advanced Tab

[options="header", width="90%", cols="1,3"]
|===
|Option|Description
2+|Success On
|Success condition a|Which condition to validate for a successful run

* Success when all works
* Success when at least x files decrypted
* Success when number of errors lesser than
|Nr error lesser than|Success if errors lesser than.
2+|Result files name
|Add files to result files name|
|===
