Focal Point
[SOLVED] Encrypt file from FEX via DOS Command Line

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3537003276

August 22, 2014, 03:05 AM
WFtESTER
[SOLVED] Encrypt file from FEX via DOS Command Line
Hi all

We are using http://gpg4win.org/ gpg for windows to encrypt and decrypt files.

If I run the following line in a dos prompt or from a batch file: EnyryptMyFile.cmd on the webfocus server it is creating my encrypted file as expected.

gpg -r MyGPGID -e //server/share/path/to/myfile

But when I start the same command from within a fex file:

!gpg -r MyGPGID -e //server/share/path/to/myfile

I get the following error:

gpg: MyGPGID: No public key


Any idea how I can get this work?

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 8.1.0.5 (Server + Client)
Windows 2012 R2
BW, Oracle, Excel, PDF, HTML
August 22, 2014, 03:26 PM
TexasStingray
The likely issue is that when you run the command you have access to the //server and when the WebFOCUS Reporting Server runs it it is not running it as you and the id it runs as does not have access to the share. run the whoami command and see who the reporting server is running as.




Scott

The user which is running has access to the share. By the way it should encrypt a file which was prior created on this share within the same fex.

Since the user is also in the local admin group of the webfocus server I did a test with a local file and the result is the same:

gpg: E:\\temp\\test.txt: encryption failed: no public key


WebFOCUS 8.1.0.5 (Server + Client)
Windows 2012 R2
BW, Oracle, Excel, PDF, HTML
I would suggest checking gpg help or suppport on the no public key error, to see what it means.

Can you log into the server with the user that WebFOCUS uses ? and try encrypting/decrypting something ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

Basically the error message is stating that GPG doesn't have a public key for the recipient you are trying to use - MyGPGID

If you hve created you key pairs then you can see the keys available with

gpg --list-keys

Remember that GPG is user independant, so you must import the keys you need as the user that WebFOCUS Reporting Server is running as.

Cheers

Stu


WebFOCUS 8.2.03 (8.2.06 in testing)
I did some more tests and know why it is/was not working.

It was not enough to install it under the application user which was running all the webfocus services. In addition I did the import of the keys via Developer Studio (fex). Otherwise it was creating the keychain under C:\gnupg\ instad of the users profile: %appdata%\gnupg\

  ! gpg --import e:\path\to\key\public.gpg 


So after deleting all the keys under C:\gnupg\ and creating the new one via WF DevStudio it was working fine from DevStudio.

----

Now I did the first test with Report Caster and there I got the message that there is no key in C:\gnupg\ *lol*.

At least I konw know where to search...

and hopefully someone can use this information.

Thank you all for your support.


WebFOCUS 8.1.0.5 (Server + Client)
Windows 2012 R2
BW, Oracle, Excel, PDF, HTML