Help: GPG.exe in batch mode on windows

withjr withjr at yahoo.com
Fri Aug 5 11:16:44 CEST 2005


Respected all,

I m using GPG 1.4.1

In my mutlithreaded application made in MS Visual C++ 6, i m using
GPG.exe as command line to generate keys, encrypt file for rcpt and
decrypt for rcpt.

As my application is multithreaded sometimes GPG fails to generate
keys and fails to decrypt message.. i come to know this because when
i import pub/private key after gen-key it returns empty file with --
output. and same for encryption it doesnt generates output files.

following are commands that i m useing

//////////////////////////
// for geneating key

szCommandLine = "C:\\GNUPG\\gpg.exe --ignore-valid-from --ignore-time-
conflict --batch --gen-key C:\\def.inc";

def.inc contains:
Key-Type: DSA
Key-Length: 1024
Subkey-Type: ELG-E
Subkey-Length: 1024
Name-Real: TEEST
Name-Comment: This is automated key
Name-Email: test at ...
Expire-Date: 0
Passphrase: 123456890

//////////////////////////
// for encryption

// import public key
sCmd = "C:\\Gnupg\\gpg.exe --import --ignore-valid-from --ignore-time-
conflict C:\\hispubkey.txt";


hispubkey.txt contains publickey of somebody at ...

// encrypt
szEncryptCmd = "C:\\gnupg\\gpg.exe --armor --ignore-valid-from --
ignore-time-conflict --always-trust --output C:\\enText.txt
-r " + somebody at ... --encrypt C:\\plText.txt";



here it is not generating enText.txt

Any help and suggestions.


Thanks In Advance

Jetli Raghu










More information about the Gnupg-devel mailing list