X

The Integration blog covers the latest in product updates, best practices, customer stories, and more.

How to Encrypt/Decrypt Files in OIC

Bipin Kumar
Techincal Lead

Encrypt/Decrypt capabilities in Stage Files

You may have a scenario where the requirement is to retrieve an encrypted file from sFTP server and send that to external REST endpoint in encrypted/unencrypted mode with additional capabilities such as processing in the middle. 

Stage File action in Integration canvas supports various file operations (list/read/write/zip/unzip). Existing OIC feature (oic.ics.stagefile.pgp.key.support) enables decrypt option while reading entire file and encrypt option while writing file. This feature is useful to process the file upto 10 MB size and doesn't support decryption option while doing read file in segments. For more details, see blog: Using Stage File Read/Write operation to encrypt/decrypt files.  

This blog explains the new feature(oic.ics.stagefile.firstclass.encrypt-decrypt ) which allows OIC user to encrypt or decrypt file of size up to 1GB.

Prerequisite

Enable following features:

  • oic.suite.settings.certificate  (It will allow user to manage certificate life cycle in OIC)
  • oic.ics.stagefile.firstclass.encrypt-decrypt (It will allow user to Encrypt or Decrypt a large file in stage file)

To enable feature flags - Refer to Blog on Enabling Feature Flags in Oracle Integration

The minimum Oracle Integration version required for the feature is 191216.1400.33050.

Step By Step Guide

  • Upload PGP public/private keys : Refer  "To upload PGP Keys"  mentioned in the blog 
  • To Configure Stage Encrypt File action with PGP Key to encrypt file 

    • Drag and drop the Stage File Action. A popup wizard will be opened where you need to provide the value for the field  "What do you want to call your action ? ".

    • Click Next and Select "Choose Stage File Operation" as Encrypt File.
    • Specify the File Reference - Click the Expression Builder icon to build an expression to specify the file reference.
    • Specify the File Name - Click the Expression Builder icon to build an expression to specify the file name.
    • Specify the Output Directory - Click the Expression Builder icon to build an expression to specify the output directory.
    • Select PGP Key to encrypt file- Select the PGP Public Key to encrypt the file. This is the PGP public key you uploaded at the beginning.

                    

  • Click on Next and it will display the summary page. Now click on Done.

              

  • To configure Stage Decrypt File Operation with PGP Key to decrypt file

    • Drag and drop the Stage File Action. A popup wizard will be opened where you need to provide the value for the field  "What do you want to call your action ? ". 

       
       
    • Click Next and Select "Choose Stage File Operation" as Decrypt File.
    • Specify the File Reference - Click the Expression Builder icon to build an expression to specify the file reference.
    • Specify the File Name - Click the Expression Builder icon to build an expression to specify the file name.
    • Specify the Output Directory - Click the Expression Builder icon to build an expression to specify the output directory.
    • Select PGP Key to decrypt file- Select the PGP Private Key to decrypt the file.

    •  Click Next and it will display the summary page. Now click on Done.

          

Samples

Stage Encrypt File Integration to encrypt file

IAR

This Integration

  • Encrypts and Writes the file to stage location using Stage Encrypt File Operation with PGP Public Key.
  • Writes the encrypted file to output directory from stage location.

 Stage Decrypt File Integration to decrypt encrypted file

 

IAR

This Integration

  • Reads and Decrypts the downloaded file using Stage Decrypt File Operation using  PGP Private Key
  • Writes the decrypted file to output directory from stage location

 

Join the discussion

Comments ( 1 )
  • gouthamraj Monday, December 30, 2019
    Good Blog, well descrided, Thanks for sharing this information.
    Oracle Integration Cloud Service Online Training
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.