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

Last updated on NOVEMBER 09, 2016

Applies to:

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

Symptoms

PROBLEM DESCRIPTION
--------------------
While using 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 password.txt file that has the following:
welcome1
3. Create SourceFile.txt that has the following message that you will encrypt:
This is a test
4. Create gpgFileEncryption.bat (.sh) that has the following line (for windows):

gpg2.exe --symmetric --status-fd --batch --yes --passphrase-file password.txt --output D:\output\TargetFile.txt.gpg D:\sourcefile\SourceFile.txt

5. For linux:

gpg --symmetric --status-fd --batch --yes --passphrase-file /home/test/password.txt --output /home/test/TargetFile.txt.gpg /home/test/SourceFile.txt

6. Test it in the command line by running the gpgFileEncryption.bat (TargetFile.txt.gpg will be created and if you open it with an editor you will see an encrypted text.)

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

 

Cause

Sign In with your My Oracle Support account

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

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms