Read DSA public key from file

Dirk Neumann dirkneumann at gmx.ch
Sun Jan 2 16:03:28 CET 2011


Hi,

I try to create a S-expression which contains a DSA public key. As far
as I understand the manual and the tests/, I have to use something like

error=gcry_sexp_build(&key_public,NULL,
                      "(public-key(dsa(p%m)(q%m)(g%m)(y%m)))",
                      p.size(),p.data(),q.size(),q.data(),
                      g.size(),g.data(),y.size(),y.data());

All I have is an export of the DSA-public key from GPG. How can I
decompose that stream into the components p,q,g,y? Is there a
documentation of the format of GPG-exports (beside the GPG-source?) or
a magic function which does that task?


Thanks in advance,

Dirk.



More information about the Gcrypt-devel mailing list