Learn how to set up GPG Decryption in Unqork to decrypt GPG-encrypted files in an module.
Setting up GPG decryption in Unqork involves a three-step process:
Configure a Decryption (GPG) Service: Create a GPG Decryption service in Services Administration.
Enable Server-Side Execute: Set up a module to execute its data server-side.
Execute via Plug-In: Use a Plug-in component to decrypt specific files using the parameters defined in your GPG Service.
The encrypted file being passed in must be less than 50 MB, and the resulting decrypted file must be less than 100 MB. Otherwise, the decryption fails.
Preconfiguration
Before configuring the module, set up the decryption service to connect with the party sending GPG-encrypted files.
Set Up the Decryption (GPG) Service
First, set up a Decryption (GPG) service in Services Administration.
You'll need to get the public key from the party that's receiving and decrypting the files. They'll have set up the public/private GPG keypair.
At the top right of the Unqork Designer Platform, click Administration.
Under Integration, select Services Administration.
Click + Add a Service.
In the Service Title* field, enter a title for your service. For example,
GPG Decryption.In the Service Name* field, enter a name for your service. For example,
gpg-decryption.The Service Name value is final once created. You can update the Service Title value anytime.
In the Service protocol + host* field, enter a temporary value. You’ll delete these values in a later step.
Click Next.
In the Share To* field, specify which workspaces this service is available to.
Click Create.
The Service page displays.From the menu to the left, select Service-Type.
From the Service Type drop-down, select Decryption.
In the Service Protocol + Host field, delete the temporary value.
Set the Authentication Method to Decryption (GPG).
In the Private Key field, enter the decryption key.
The public key must be provided by the service with which you’re integrating. A sample key is not available.

Click Save Changes.
After enabling the GPG Encryption service, return to the Module Builder.
Select the tab that corresponds to your Unqork Designer experience:
Turn on Server-Side Execute Only
For security, modules calling a GPG service must execute server-side. While API Modules always execute server side, your requirements might use a Front-End or Other module type to contain the Plug-In Component that calls the GPG service.
From the Module Builder page:
Click the
(ellipsis) button. Click Module Settings. The Settings modal displays.
From the menu to the left, click Module Settings.
Set Server Side Execution Only to
(ON).
Click Save & Close.
Configure the Decryption Module
Set up a module to retrieve encrypted files using SFTP, then decrypt them.
This configuration includes only the components involved in decrypting a file. For example, the Plug-In component references a File Storage component. But, there aren't steps in this how-to guide for adding a File Storage component. Instead, reference the File Storage component your application already uses to receive files via SFTP.
Configure the pluginDecrypt Plug-In Component
This Plug-In component runs the GPG Decrypt a File API call. In the Outputs table, you can directly output the decrypted file to a Hidden component. The Inputs table needs to reference two values:
The Property ID of the component containing the file you want to decrypt. You can use dot notation to specify the exact path. This value maps to the file parameter.
The Service Name of your Decryption (GPG) service. This value maps to the
{{serviceName}}parameter.
Set up the Plug-In component:
In the Module Builder, drag and drop a Plug-In component onto the canvas.
In the Property ID and Canvas Label Text fields, enter
pluginDecrypt.From the Internal Services drop-down, select GPG Decrypt a File.
Set Make a Multipart API Call to
(ON).In the Inputs table, enter the following:
#
Property ID
Mapping
1
fileStorage.file
file
2
'GPG-decryption'
{{serviceName}}
Ensure you use the File Storage component’s Property ID and Service Name appropriate to your use case. This how-to guide maps sample values to these parameters. For example, let's say your application receives files from a File Storage component with a Property ID of
fsContract. Then, you'd enterfsContract.filein the first row of the Inputs table instead offileStorage.file.Always add single quotes around values in the Property ID column that are not Property IDs in the module. For example,
fileStorage.filereferences the File Storage component in your module, so it doesn't need single quotes. However,‘GPG-decryption’is not a Property ID in the module. So, it needs single quotes.In the Outputs table, enter the following:
#
Property ID
Mapping
Option
1
decryptedFile
file
replace

Click Save.
Configure the decryptedFile Hidden Component
Lastly, set up a Hidden component to store the decrypted file.
Drag and drop a Hidden component onto your canvas, placing it below your
pluginDecryptPlug-In component.In the Property ID and Canvas Label Text fields, enter
decryptedFile.Click Save & Close.
Save your module.
Now you can access the decrypted file in the decryptedFile Hidden component.
Here's how the final configuration looks in the Module Builder:

Turn on Server-Side Execute Only
For security, modules calling a GPG service must execute server-side. While API Module always execute server side, your requirements might use a Front-End or Other module type to contain the Plug-In Component that calls the GPG service.
From the Module Builder page:
On the Module Builder header, click the
(ellipsis) button. Click Settings. The Settings modal displays.
Navigate to the Module Settings section.
Set Server Side Execution Only to
(ON).
Click Save.
Configure the Decryption Module
Set up a module to retrieve encrypted files using SFTP, then decrypt them.
This configuration includes only the components involved in decrypting a file. For example, the Plug-In component references a File Storage component. But, there aren't steps in this how-to guide for adding a File Storage component. Instead, reference the File Storage component your application already uses to receive files via SFTP.
Configure the pluginDecrypt Plug-In Component
This Plug-In component runs the GPG Decrypt a File API call. In the Outputs table, you can directly output the decrypted file to a Hidden component. The Inputs table needs to reference two values:
The Property ID of the component containing the file you want to decrypt. You can use dot notation to specify the exact path. This value maps to the file parameter.
The Service Name of your Decryption (GPG) service. This value maps to the
{{serviceName}}parameter.
Set up the Plug-In component:
In the Module Builder, drag and drop a Plug-In component onto the canvas.
In the Property ID and Canvas Label Text fields, enter
pluginDecrypt.From the Internal Services drop-down, select GPG Decrypt a File.
Set Make a Multipart API Call to
(ON).In the Inputs table, enter the following:
Property ID
Mapping
fileStorage.file
file
'GPG-decryption'
{{serviceName}}
Be sure to use the File Storage component’s Property ID and Service Name appropriate to your use case. This how-to guide maps sample values to these parameters. For example, let's say your application receives files from a File Storage component with a Property ID of
fsContract. Then, you'd enterfsContract.filein the first row of the Inputs table instead offileStorage.file.Always add single quotes around values in the Property ID column that are not Property IDs in the module. For example,
fileStorage.filereferences the File Storage component in your module, so it doesn't need single quotes. However,‘GPG-decryption’is not a Property ID in the module. So, it needs single quotes.In the Outputs table, enter the following:
Property ID
Mapping
Option
decryptedFile
file
replace

Click Save.
Configure the decryptedFile Hidden Component
Lastly, set up a Hidden component to store the decrypted file.
Drag and drop a Hidden component onto your canvas, placing it below your
pluginDecryptPlug-In component.In the Property ID and Canvas Label Text fields, enter
decryptedFile.Click Save & Close.
Save your module.
Now you can access the decrypted file in the decryptedFile Hidden component.
Here's how the final configuration looks in the Module Builder:
