--logger-fd n in Windows Visual Basic
ravital at netbox.com
ravital at netbox.com
Wed Jun 9 21:19:52 CEST 2004
Forgive a silly question:
As long as you're going to write key information to a file, couldn't you
just use ".....--list-packets >> filename.txt" instead of "--output" ?
Also, you might want to look at this:
http://sourceforge.net/projects/cryptotw/
This is an open-source Windows DLL (don't try to register it as an
Active-X, it's not that sophisticated and it won't show up in VB's wizards
either), which as part of a function designed to check signatures, does
collect the output of --list-packets into a file.
[There was a bug in a previous version where it stored the packet output in
"fileA.txt" and was trying to read it back from "fileB.txt" - I'm told
that's been fixed, but I haven't tested it. Get the source code and see
the bug log accessible from the project's main page, I remember logging
the exact module and line-number where the problem happened. I got around
the problem by creating a copy of the original file under the second name
and write-protecting both files. My application may be different from
yours, I actually check the validity of signatures against my keyring
before decrypting, but given that it does produce a file with the output
you're looking for, it may be what you need.]
Hope this helps.
Original Message:
-----------------
From: David Hill DHill at StudentLoan.org
Date: Wed, 9 Jun 2004 13:31:53 -0500
To: gnupg-users at gnupg.org
Subject: --logger-fd n in Windows Visual Basic
Alright, I've beaten myself bloody trying to figure this out, I haven't
found anything in the archives, time to give up and ask for help.
I am working in Windows, programming in Visual Basic and I need to use
GnuPG to encrypt and sign files, decrypt files, and verify signatures.
Encryption and decryption is cake, but getting access to stderr to get key
information is killing me. So THEN I thought I'd just do the key check in a
separate step from the decryption command, I piped output from
--list-packets to an --output file. As you might guess, no output file is
created even though the only output of --list-packets is the packet
information, probably went to stderr instead of my file.
I've put together a simple ActiveX dll that creates and shells batch files
to interface with GnuPG. Apparently I can redirect the non-file output by
using --logger-fd and giving it a file descriptor number. An interesting
method of naming an output file, personally I might have recommended a
command line file name much like --output uses, but let's get past that for
now. Can anyone tell me how to create a file descriptor in Windows that
this thing will accept? Is there an API that I should use to
allocate/deallocate a file descriptor?
GPGME looked like an interesting alternative to rolling my own interface,
unfortunately it doesn't come compiled, only as a big pile of source code.
Also couldn't find any compatibility statement that indicated it would even
work if I tried to compile and use it in Windows. Rolling my own for the
few functions I needed probably took less time than getting a GPGME compile
to run, if only there were a rational way to access the stderr information.
Dave Hill
dhill at studentloan.org
Iowa Student Loan Liquidity Corp.
515-273-7241
Fax 515-243-0714
--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .
More information about the Gnupg-users
mailing list