Identify a gpg file

Werner Koch wk at gnupg.org
Thu Jul 25 21:19:58 CEST 2013


On Thu, 25 Jul 2013 20:36, hans at guardianproject.info said:

> extensions by default everywhere.  So things like .pkr for public keys, .skr
> for private keys, .sig for binary detach-sign, etc.  Any specific format that

With two drawbacks:  You need to have a filename and you need extra code
to handle data with a wrong suffix.  Yes, that happends.

> should avoid adding the ambiguous extensions, like .gpg, .pgp, .asc, but

That is easy.  GPGME does not know anything about suffixes and with GPG
you should specificy the filename anyway yourself.  The extensions are
only used by default for convenience.

> As a side note, the file-5.14 detection could use some improvement.  Its not
> detecting keys and detached signatures as something distinct.  It seems that
> the logic in gpa/src/filetype.c could be contributed to file.

Last time I checked file(1) uses a not too simple pattern matching
system, thus it is not easy to re-use the code - but possible.


Salam-Shalom,

   Werner

-- 
Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.




More information about the Gnupg-devel mailing list