You got it.  Call RSA_new() to allocate and initialize the RSA struct, the
BN_bin2bn to generate the BIGNUM's.  Something along the following lines
should do it:
        RSA* rsa = RSA_new();
        rsa->n = BN_bin2bn(modulus, modulus_size, NULL);
        rsa->e = BN_bin2bn(exponent, exponent_size, NULL);

Regards,

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


> -----Original Message-----
> From: bruce cartland [SMTP:[EMAIL PROTECTED]]
> Sent: Friday, March 09, 2001 9:16 AM
> To:   [EMAIL PROTECTED]
> Subject:      How do I construct an instance of RSA using n & e
> 
>  I have n (the public modulus) and e (the public exponent). No nicely
> encoded data. Given those two values is there an API set to construct the
> RSA (public key) structure? I'm guessing I'd have to create a BIGNUM first
> then ..? Nothing obvious in rsa.h. Would it be reasonable to create a new
> RSA struct then set the pointers directly?
> thanks
> 
> bruce
> 
> 
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> User Support Mailing List                    [EMAIL PROTECTED]
> Automated List Manager                           [EMAIL PROTECTED]
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to