[Gpg4win-users-en] GPG Encryption Fails When Called From Oracle Enterprise Manager

Andre Heinecke aheinecke at intevation.de
Tue Jul 14 09:48:40 CEST 2015


Hi,

On Monday, July 13, 2015 06:19:22 PM Kent Hurtig wrote:
> Hi Andre,
> 
> I added the --trust-model always option to my encryption command:
> 
> gpg -vv --debug-all --batch --trust-model always --default-recipient
> 21CBF00F --encrypt E:\Test\ECSI_Perkins_Loan_Test\TESTbldpromIG.csv

Btw why do you use --default-recipient and not --recipient?

> The output (abbreviated) from the task is below:
> 
> E:\Test\ECSI_Perkins_Loan_Test\Scripts>gpg -vv --debug-all --batch
> --trust-model always --default-recipient
> 
> 21CBF00F --encrypt E:\Test\ECSI_Perkins_Loan_Test\TESTbldpromIG.csv
> gpg: NOTE: no default option file
> `C:/Windows/system32/config/systemprofile/AppData/Roaming/gnupg/gpg.conf'
> gpg: enabled debug flags: packet mpi cipher filter iobuf memory cache
> memstat trust hashing extprog cardio
> 
> assuan
> gpg: DBG: fd_cache_open
> (C:/Windows/system32/config/systemprofile/AppData/Roaming/gnupg/pubring.gpg
> ) not
> 
> cached
> gpg: DBG: iobuf-1.0: open
> `C:/Windows/system32/config/systemprofile/AppData/Roaming/gnupg/pubring.gpg
> '
> 
> fd=268
> gpg: DBG: iobuf-1.0: underflow: req=8192
> gpg: DBG: iobuf-1.0: underflow: got=0 rc=-1
> gpg: DBG:
> C:/Windows/system32/config/systemprofile/AppData/Roaming/gnupg/pubring.gpg:
> close handle 0000010C gpg: DBG: fd_cache_close
> (C:/Windows/system32/config/systemprofile/AppData/Roaming/gnupg/pubring.gpg
> ) new
> 
> slot created
> gpg: DBG: iobuf-1.0: underflow: eof
> gpg: DBG: iobuf-1.0: close `?'
> gpg: unknown default recipient "21CBF00F"
> gpg: E:\\Test\\ECSI_Perkins_Loan_Test\\TESTbldpromIG.csv: encryption failed:
> No public key random usage: poolsize=600 mixed=0 polls=0/0 added=0/0
>               outmix=0 getlvl1=0/0 getlvl2=0/0
> secmem usage: 0/32768 bytes in 0 blocks

Yes, again it looks for the key 21CBF00F in: 
C:/Windows/system32/config/systemprofile/AppData/Roaming/gnupg/pubring.gpg:

where It can't find it (which was your original problem I think).

> I checked and my secret key is located in my secring.gpg which is under my
> C:\gnupg directory.  I ran the following encryption command:
> 
> gpg -vv --debug-all --batch --homedir C:\gnupg --default-recipient 21CBF00F
> --lsign 21CBF00F --encrypt E:\Test\ECSI_Perkins_Loan_Test\TESTbldpromIG.csv
> 
> The task did not encrypt the file.

--lsign is a command in its self. lsign marks a key as trusted. It is an 
alternative to trust-model always. lsign and encrypt are alternative commands 
so thats why this command does not encrypt.

> Any ideas?  I don't know why I cannot encrypt the file through our job
> scheduler, but have no problem encrypting it on the actual server via
> command line.

Use your first command with the correct homedir. 

You might also want to read some documentation for the arguments you are using 
to better understand what you are doing:

https://www.gnupg.org/documentation/manpage.html


Regards,
Andre


-- 
Andre Heinecke |  ++49-541-335083-262  |  http://www.intevation.de/
Intevation GmbH, Neuer Graben 17, 49074 Osnabrück | AG Osnabrück, HR B 18998
Geschäftsführer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.wald.intevation.org/pipermail/gpg4win-users-en/attachments/20150714/83bc5cfe/attachment.sig>


More information about the Gpg4win-users-en mailing list