An RSA private key, in addition to containing the private key components,
contains the components of the associated RSA public key.  A public key
consists of the following components:
        n, e
A private key consists of the following components:
        n, e, d, p, q, dmpq, dmq1, iqmp
So, when you read in your RSA private key and get an EVP_PKEY, you can use
that same EVP_PKEY as both a private and a public key.

Regards,

Steven
--
Steven Reddie <[EMAIL PROTECTED]>
Senior Software Engineer
Computer Associates Pty Ltd (Australia)

> -----Original Message-----
> From: chris luchini [SMTP:[EMAIL PROTECTED]]
> Sent: Wednesday, February 07, 2001 11:55 AM
> To:   [EMAIL PROTECTED]
> Subject:      Direct read of RSA public key
> 
> 1) what I'd _like_ to do is generate an RSA private/public key pair and
> then read them in directly, without having to generate a certificate,
> x509 object
> etc. 
> 
> demos/sign/sign.c uses PEM_read_PrivateKey, but there doesn't appear to
> be
> a corresponding PEM_read_PublicKey. The read of the private key works
> fine, but
> I get a 
> 13451:error:0906D06C:PEM routines:PEM_read_bio:no start
> line:pem_lib.c:662:Expecting: CERTIFICATE
> when it pass it a publickey.pem generated using the openssl rsa ...
> command. 
> 
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to