Check if file is a key file

Kiefer, Sascha sk at intertivity.com
Thu Feb 24 21:45:02 CET 2005


 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Yep. It can be X.509 certificate, or a PKCS#12 file; they will be handled
differently.
Or maybe somebody selects a totally different file, and so on!
Bye the way, i'm looking for a windows solution.


> -----Original Message-----
> From: Olaf Gellert [mailto:og at pre-secure.de] 
> Sent: Donnerstag, 24. Februar 2005 21:34
> To: sk at intertivity.com
> Cc: gnupg-users at gnupg.org
> Subject: Re: Check if file is a key file
> 
> 
> Kiefer, Sascha wrote:
> 
> > As i'm writing a program that automates the gnupg stuff and 
> i want to 
> > achive the following: I have a file. Maybe it is a valid 
> key file or 
> > it is not. But i want that gnupg finds
> > it out for me. My idea was to use dry-run and import: if 
> gnupg is possible
> > to import
> > something then I'm sure the file is a key file (or at 
> least, it has an key
> > in it).
> > This works fine if the file contains just one key but if 
> the file contains
> > about 1000-5000
> > Key,s things are getting slow. So is there a command that 
> tests a file?
> 
> What else could the file be? If I just use the unix command 
> "file" on some files, I already get the following:
> 
> > file .gnupg/pubring.gpg
> .gnupg/pubring.gpg: data
> > file .gnupg/secring.gpg
> .gnupg/secring.gpg: PGP key security ring
> > file gellert.asc
> gellert.asc: PGP armored data public key block
> 
> So it does not recognize a GPG public keyring, but it
> does recognize secret keyrings and ASCII-armored keys.
> 
> Or do you need something that really checks if the
> file contains a VALID key?
> 
> Cheers, Olaf
> 
> -- 
> Dipl.Inform. Olaf Gellert                  PRESECURE (R)
> Senior Researcher,                       Consulting GmbH
> Phone: (+49) 0700 / PRESECURE           og at pre-secure.de
> 
>                         A daily view on Internet Attacks
>                         https://www.ecsirt.net/sensornet
> 
-----BEGIN PGP SIGNATURE-----
Version: PGP 8.1

iQA/AwUBQh48zQInDejiptdCEQJ8hgCgzkdMW04wIarv15d+S8hMXQbo8VMAoL7F
DFTS+BDD3SAaa/F46Te+kcyO
=9x/V
-----END PGP SIGNATURE-----





More information about the Gnupg-users mailing list