Creating an X509 certificate

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Creating an X509 certificate

Matthieu BONETTI
Hello,

I'm trying to write a program that create a new certificate.
Here is what I am doing:

EVP_PKEY_new();
RSA_generate_key();
EVP_PKEY_assign_RSA();
X509_new();
/* Lots of functions to fill up the certificate details */
X509_set_pubkey();

This is perfectyl working, but, how can I now assign the RSA key as a private key
to my certificate?
Then, is the public computed automaticly ?

I've read some code and some manuals but I still can't find how to do this.

Best regards,

--
Matthieu Bonetti
Mobile. +33 684 957 844 - Portable. 06 84 95 78 44

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Creating an X509 certificate

Marek.Marcola
Hello

> This is perfectyl working, but, how can I now assign the RSA key as a private key
> to my certificate?
> Then, is the public computed automaticly ?
Certificate consists public part of RSA key (n - modulus,
e - publicExponent,Exponent) so if you have private
key file (eg key.pem) and "coresponding" certificate file (eg cert.pem)
you may display these numbers from files and check if they are
equal:
        $ openssl rsa -in key.pem -text -noout
        $ openssl x509 -in cert.pem -text -noout

Best regards,
--
Marek Marcola <[hidden email]>

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]