[SalesForce] File Transfer Activity Encrypt and Decrypt with PGP

Using a File Transfer Activity and Import File Activity in an automation (File Drop), I am trying to read a CSV file into one of my data extensions. Halfway through the process, there is an update to the blueprint: the transfer should be encrypted using Safehouse.

We are given a PGP Public Key which I have already added to Key Management (I pasted the entire key block with opening and closing blocks).

What I want to know is how to arrange this automation and where should the Encryption and Decryption inside The File Transfer Activity and Import File Activity take place.

Best Answer

I'm not sure which PGP public key you are using. You can use a public key to encrypt a PGP file, but you can't use a public key alone to decrypt a PGP file as this will require the corresponding private key (unless you are using the ExactTarget public key).

I believe it is possible to use your own PGP public/private key combination with Safehouse, but you will need to open a support case to have this configured. I've never done this though. My advice would be to encrypt the PGP file using the ExactTarget PGP public key (if you are not doing so already) which you can download here.

Here are the two steps that should appear in your Automation.

1. File Transfer Activity

  • Set Transfer Type as 'Download'
  • Set the File location to where the file is transferred to
  • Set File naming pattern to %%FILENAME_FROM_TRIGGER%%
  • Enable 'File is encrypted' in Transfer Settings
  • Configure other settings as you normally would

2. Import Activity

  • Set file location to 'Safehouse'
  • Set filenaming pattern to %%BASEFILENAME_FROM_TRIGGER%%.csv (change 'csv' to match the file extension of the decrypted file)
  • Configure other settings as you normally would

Safehouse

The Safehouse file location is not created by default. If you do not have this in Email app > Admin > Data Management > File Locations, create one named 'Safehouse' and set the Location Type to 'Safehouse'.

Note that I've configured a couple of different accounts recently where importing decrypted PGP files fail. If the automation fails on the import activity as it can't find the decrypted file in Safehouse, then you will need to open a support case to have this configured.

Related Topic