OpenPGP headers

Christian Biere cbiere at TechFak.Uni-Bielefeld.DE
Mon Aug 9 18:41:10 CEST 2004


Atom 'Smasher' wrote:
> OpenPGP-KeyID: 0xD9F57808
> OpenPGP-KeyID: 0xD9F57808 (4096-RSA)
> OpenPGP-KeyID: 0xB88D52E4D9F57808
> OpenPGP-KeyID: 0xB88D52E4D9F57808 (4096-RSA)

I would rather make the key ID unambigous by using

	OpenPGP-KeyID: id=0x12345678

Otherwise, you need some special rules to figure out which element is
which if there's more than one element in a body and 0x is rather
a hack than good practice, especially as it could easily be discarded
resp. forgotten.

Comments should always be handled by the parses but they're not useful for
providing parseable data. Instead use something like this:

	OpenPGP-KeyID: id=0x12345678; algo=RSA; bits=4096

If you want more than the plain ID in the header, it might be less
confusing to rename the header e.g. OpenPGP-Key or OpenPGP-KeyInfo.
I'm not sure if your example implies that one can suggest more than
key to use. If yes, providing more than one OpenPGP-KeyID header
can't work as above. That's not how headers are parsed:

	Blah: a; b
	Blah: c; d

evaluates to the same as this:

	Blah: b; d; c; a

The order of the tokens doesn't matter. I'm not sure but I think the
right way to group keys with their attribute would be this:

	OpenPGP-KeyID: id=0x12345678, algo=RSA, bits=4096
	OpenPGP-KeyID: id=0x87654321, algo=DSA, bits=2048

evaluates to the same as this:
	
	OpenPGP-KeyID: id=0x12345678, algo=RSA, bits=4096;
		id=0x87654321, algo=DSA, bits=2048
 
> 	long (16 character) or short (8 character) key id which MUST be
> 	prefixed with "0x". key id MAY be followed by information about
> 	key size and key type: this optional information, if included,
> 	MUST be contained in parenthesis and SHOULD be in the format of
> 	key size, dash, key type.

Well, that's completely different to semantics and rules as defined by
RFC 2822. You want standard parsers to be able to handle the headers and
you don't want to re-define the semantics of any tokens.

> OpenPGP-Fingerprint: 762A 3B98 A3C3 96C9 C6B7  582A B88D 52E4 D9F5 7808

Nay, that's horrible. Use at least double-quotes around that.

-- 
Christian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 303 bytes
Desc: not available
Url : /pipermail/attachments/20040809/7aade5a7/attachment.bin


More information about the Gnupg-devel mailing list