On 5/8/2012 3:13 AM, Bodo Moeller wrote:

    I noticed that EC_KEY (ec_key_st) is not defined in ec.h but in
    ec_lcl.h which is not a public header file, not like RSA(rsa_st) in
    rsa.h and DSA in dsa.h. Is that correct?


  Yes, this is intentional - this intentionally prevents applications
from accessing ec_key_st fields directly, forcing them to use the proper
exported APIs so that they won't depend on internal implementation
details.   Previously existing structs such as those for RSA and DSA
were never changed like that to restrict visibility (for one thing, this
probably would break applications that *do* depend on internal
implementation details, even though this is bad style).

My application requires me to constantly do things like:

- return n, e, p from an openssl RSA key token
- construct an openssl RSA public key token from n, e
- construct an openssl RSA private key token from n, e, p

I do this using the bignum-bin converters and knowledge of the RSA structure. While this might be 'bad style', is there any better way?

ECC has EC_KEY_set_group() and EC_KEY_set_public_key() for public keys and I haven't had to work with a private key yet.



______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to