You can upload and download encrypted files from Adaptive Planning using Pretty Good Privacy(PGP) to a Secure FTP (SFTP) server. This article explains how to create PGP credentials from Design Integrations, how to add PGP encryption to your CCDS and how to encrypt and decrypt files using PGP.
Before you Begin
- Create a PGP Encryption credential.
- Input the partner key.
- Download your public key.
- Add the PGP Encryption to your CCDS.
- Include PGP encryption or decryption in your script.
How you get There
Depuis nav menu, accédez à Integration > Intégrations de conception
Create a PGP Encryption credential
A new PGP encryption includes a 2048 bit key pair. Public key is visible in the form and available as a download in the Actions pane. The private key is hidden and can not be exported.
- Create a PGP Encryption credential from Credentials pane in Design Integrations.
- Enter a name for the PGP encryption credential.
Input the Partner Key
A partner key is required to encrypt files or text for the partner. Your partner key comes from the .asc file you received.
- Copy all of the text from your .asc file, including
-----BEGIN PGP PUBLIC KEY BLOCK-----and
-----END PGP PUBLIC KEY BLOCK-----
- Paste the key in the Partner key field and save the form.
Download the Public Key
Select Download public key from the Actions pane. This generates your public key in an .asc file and downloads it to your local file manager.
Add PGP Encryption to your CCDS
To create a CCDS, see Workflow for developing a CCDS.
- Select your CCDS from Data Sources.
- Select the Designer Settings tab for your CCDS.
- Drag and drop the PGP Encryption parameter from Additional Settings in the Settings Component pane. The setting name is the handle you will use inside your script. For example: 'myPgp'
Include PGP Encryption or Decryption in your Script
Use the following methods to encrypt text into a PGP message with the partner key or decrypt a PGP message with the private key. To create a client, upload and download encrypted files with PGP encryption and decryption, see ai.sftp.
- ai.util.encrypt(text, pgpEncryptionSettingName)
Example to encrypt a text string with PGP:
const encryptedText = ai.util.encrypt('Text to encrypt','myPgp');
- ai.util.decrypt(message, pgpEncryptionSettingName)
Example to decrypt a PGP message:
const decryptedText = ai.util.decrypt(encryptedText,'myPgp');