My Oracle Support Banner

Getting Error : Calling External Shell Script From OAG Using PGP Commands To Encrypt-Decrypt Some Files (Doc ID 2069484.1)

Last updated on AUGUST 02, 2023

Applies to:

Oracle API Gateway - Version 11.1.2.1.0 and later
Information in this document applies to any platform.

Symptoms

PROBLEM DESCRIPTION
--------------------
While using the Execute Process filter to call an external script in OAG 11.1.2.1, the following error is generated

ERROR
--------



WHAT IS WORKING
---------------

The script is being called fine outside OAG. it only fails when being called from inside OAG and it only happens in Linux

ENVIRONMENT
------------
OAG 11.1.2.1
OS: Linux x86-64


STEPS
----------
1. Create a policy that has Execute Process Filter
2. Deploy the Policy
3. Call the policy

The execute process filter will call the script which should be created and tested using these steps: (test was done on windows and it was working fine)

Tutorial on gpg


https://www.deepdotweb.com/2013/11/11/pgp-tutorial-for-newbs-gpg4win/


1. Download gpg (gpg4win-2.2.6.exe) from gpg4win.org/download.html and install it
2. Create a text password file with the correct password
3. Create a file that has a message to encrypt:
4. Create a batch or script file that has the following line:

gpg2.exe --symmetric --status-fd --batch --yes --passphrase-file <PATH>\<PASSWORD FILE> --output <PATH>\<OUTPUTFILE> <PATH>\<FILE TO ENCRYPT>

5. For linux:

gpg --symmetric --status-fd --batch --yes --passphrase-file <PATH>/<PASSWORD FILE> --output <PATH>/<OUTPUTFILE> <PATH>/<FILE TO ENCRYPT>

6. Test it in the command line by running the Script file created (the output file will be created and if opened with an editor encrypted text will be seen.)

7. After testing that the script works fine, it is time to call it from OAG using Execute Process filter.

 

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.