[xmlsec] Generating RSA keys - public and private

Meg Morgan meg at votehere.net
Wed Dec 11 11:08:33 PST 2002


Hello,

I am a fairly new xmlsec user, and have found it quite
straightforward so far.  Currently I am trying to generate
both DSA and RSA private AND public keys.  They DSA keys
were easy using openssl functions:

DSA *a = DSA_generate_parameters(1024, NULL, 0, NULL, NULL, NULL, NULL);
int retval = DSA_generate_key(a);
Then:
private key is a->priv_key
public key is a->pub_key


For RSA, there is a similar function:
RSA *a RSA_generate_key(1024, 65537, NULL, NULL)
which returns a structure of BIGNUMS.  What is eluding me is
which part(s) of the structure is the private key and which is the
public.

I know I am dancing around the right answer - I even looked into
the source code of the command-line tools genrsa (openssl) and
gen-rsa (xmlsec) but wasn't sure how to distinguish between public
and private key generation.

Thank you in advance for your time and consideration,

Meg Morgan

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Meg Morgan                           425/739-2534
meg at votehere.net                   http://www.votehere.net



More information about the xmlsec mailing list