How to Determine Digest Algorithm

David Shaw dshaw at jabberwocky.com
Tue Dec 19 14:50:31 CET 2006


On Tue, Dec 19, 2006 at 09:33:25AM +0100, Patrick Brunschwig wrote:
> I'm trying to find a good way to determine the digest algorithm that
> GnuPG uses for a signed message. My problem is this: for PGP/MIME signed
> messages, I need to know the algorithm before the message is created.
> Therefore I create a signed dummy message, and extract from it the hash
> algorithm. However, the problem is that this requires the user to type
> the passphrase twice, which I would like to avoid.

What mutt does for this is to make the signature first and grab the
digest algorithm from that to make the micalg field.  Does that method
not work given the way Enigmail ties into the mail code?

> Is there a better way to determine the hash algorithm without actually
> creating a signed message?

At the moment, not really, but it's not impossible to add a way to ask
GPG the question "if you were going to make a signature, which hash
algorithm would you use".

David



More information about the Gnupg-devel mailing list