Hello.

I'm using openssl in Tcl, via Tls. Everything works great, but Tls does not allow key/certificate generation (for servers). I want to add such features to Tls.

I've read Tls and openssl sources, and it seems that what I want is in openssl/apps/req.c.

I noticed that docs on openssl.org are a bit incomplete, so I do not really understand what is happening.

I want an RSA key, so I basically do this:

            if ((pkey = EVP_PKEY_new())!=NULL)
            {
                if (!EVP_PKEY_assign_RSA(pkey,
                    RSA_generate_key(1024, 0x10001, NULL, NULL)))
                {
                    return TCL_ERROR;
                }
                in=BIO_new(BIO_s_file());
                out=BIO_new(BIO_s_file());

                EVP_PKEY_free(pkey);
            }

This should create a 1024 bit key. How do I save the key to a file, create a corresponding .pem file and save it as well?

I really get confused with the code in apps/req.c.

--
WK

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

Reply via email to