[Also applies to v8]{class="badge positive" title="Also applies to Campaign v8"}

Zip or encrypt a file zipping-or-encrypting-a-file

Adobe Campaign lets you export zipped or encrypted files. When defining an export through a Data extraction (file) activity, you can define a post-processing to zip or to encrypt the file.

To be able to do so:

  1. Install a GPG key pair for your instance using the Control Panel.

    note note
    NOTE
    Control Panel is restricted to Admin users, and available for certain Campaign versions only. Learn more
  2. If your installation of Adobe Campaign is hosted by Adobe, contact Adobe Customer Care to have the necessary utilities installed on the server.

  3. If your installation of Adobe Campaign is on premise, install the utility you want to use (for example: GPG, GZIP) as well as the necessary keys (encryption key) on the application server.

You can then use commands or code in the Script tab of the activity or in a JavaScript code activity. An example is presented in the use case below.

Related topics:

Use case: Encrypt and export data using a key installed on Control Panel use-case-gpg-encrypt

In this use case, we will build a workflow in order to encrypt and export data using a key installed on Control Panel.

Discover this feature in video

The steps to perform this use case are as follows:

  1. Generate a GPG key pair (public/private) using a GPG utility, then install the public key onto Control Panel. Detailed steps are available in Control Panel documentation.

  2. In Campaign Classic, build a workflow to export the data and encrypt it using the private key that has been installed via the Control Panel. To do this, we will build a workflow as follows:

    • Query activity: In this example, we want to execute a query to target the data from the database that we want to export.
    • Data extraction (file) activity: Extracts the data into a file.
    • JavaScript code activity: Encrypts the data to extract.
    • File transfer activity: Sends the data to an external source (in this example, an SFTP server).
  3. Configure the Query activity to target the desired data from the database. For more on this, refer to this section.

  4. Open the Data extraction (file) activity then configure it according to your needs. Global concepts on how to configure the activity are available in this section.

  5. Open the JavaScript code activity, then copy-paste the command below to encrypt the data to extract.

    note important
    IMPORTANT
    Make sure you replace the fingerprint value from the command with the fingerprint of the public key installed on the Control Panel.
    code language-none
    var cmd='gpg ';
    cmd += ' --trust-model always';
    cmd += ' --batch --yes';
    cmd += ' --recipient fingerprint';
    cmd += ' --encrypt --output ' + vars.filename + '.gpg ' + vars.filename;
    execCommand(cmd,true);
    vars.filename=vars.filename + '.gpg'
    

  6. Open the File transfer activity, then specify the SFTP server to which you want to send the file. Global concepts on how to configure the activity are available in this section.

  7. You can now run the workflow. Once it is executed, data target by the query will be exported to the SFTP server into an encrypted .gpg file.

Tutorial video video

This video shows how to use a GPG key to encrypt data is also available in

Additional Campaign Classic how-to videos are available here.

recommendation-more-help
601d79c3-e613-4db3-889a-ae959cd9e3e1