Getting Error : Calling External Shell Script From OAG Using PGP Commands To Encrypt-Decrypt Some Files

(Doc ID 2069484.1)

Last updated on APRIL 10, 2018

Applies to:

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


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



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

OS: Linux x86-64

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

1. Download gpg (gpg4win-2.2.6.exe) from and install it
2. Create password.txt file that has the following:
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.



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