Help: GPG.exe in batch mode on windows

withjr withjr at
Fri Aug 5 07:32:03 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:\\"; 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

Jay Chadderwala

More information about the Gnupg-devel mailing list