trying to use the public key functions

Glenn McGrath bug1@optushome.com.au
Fri, 17 May 2002 03:49:37 +1000


--=.:1H(3E3Keu_kyk
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

Im trying to write a program that uses libgcrypt to verify a file against
a known public gpg key.

Im really strugling to make any progress at all, as a start i would like
to be able load store and verify the public key. 

	GCRY_SEXP key;

	/* Store the key in libgcrypt's struct */
	gcry_sexp_build(/* I have no idea what goes in here */)

	/* Check the key is in a valid format */
	result = gcry_pk_testkey(key);
	if (result != 0) {
		printf("Key check failed, %s\n", gcry_strerror(result));
	}

I dont know how to trasfer the data from the .gpg file to the GCRY_SEXP
structure.

e.g. i have
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)

iEYEABECAAYFAjzivCQACgkQqn3re3IvGu0knQCfem0zm2wCWYxNgTrsjmw8f5Se
m7oAoKYonuIKxty8YWcZHTm+qo1A6oTa
=msEe
-----END PGP SIGNATURE-----

How do i format and parse this ?

It probably should be an easy question, ive been looking around the gpg
and libgpcrypt code for for a few hours trying to work it out, but im
lost. 


Thanks

Glenn
--=.:1H(3E3Keu_kyk
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE84/E7WWZyfXiLlL8RAjKdAJ4kTeyZfzmJVEYpEqL4CiWrLH5KJACeOVAQ
QTZnccYdbcBbWTMHLtFsZMU=
=J15y
-----END PGP SIGNATURE-----

--=.:1H(3E3Keu_kyk--