As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at myibi@ibi.com and provide your corporate email address, company, and name. Connect to myibi
Focal Point    Focal Point Forums    WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Encrypt file from FEX via DOS Command Line

 Go Search Notify Tools
 [SOLVED] Encrypt file from FEX via DOS Command Line
Member
 posted August 22, 2014 03:05 AM
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

 Posts: 23 | Registered: May 28, 2013 IP
Master
 posted August 22, 2014 03:26 PM Hide Post
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

 Posts: 865 | Registered: May 24, 2004 IP
Member
 posted August 22, 2014 04:57 PM Hide Post
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

 Posts: 23 | Registered: May 28, 2013 IP
Expert
 posted August 24, 2014 05:37 PM Hide Post
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.04 Upgrade: WebFOCUS 8.2.07 OS: Linux Outputs: HTML, PDF, Excel, PPT In Focus since 1984 Pity the lost knowledge of an old programmer!

 Posts: 6349 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006 IP
Guru
 posted August 25, 2014 01:02 AM Hide Post
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)

 Posts: 253 | Location: Melbourne, Australia | Registered: February 07, 2007 IP
Member
 posted September 24, 2014 06:27 AM Hide Post
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

 Posts: 23 | Registered: May 28, 2013 IP