Discussion:
What's the right way to make a RSA public key from two BIGNUM n and e?
Zihan, Sheldon Liu
2014-10-10 06:27:06 UTC
Permalink
What's the right way to make a RSA public key from two BIGNUM n (modulus)
and e (public exponent)?

RSA* pubKeyRSA = RSA_new();
pubKeyRSA->n = n;
pubKeyRSA->e = e;

This way seems working. But I didn't find it is documented anywhere.
Is there a direct API taking n and e, and returns a RSA*? Thanks.
--
Regards,
Zihan, Sheldon Liu
------------------------------------------------
Software Engineer @ Google Inc.
Ken Goldman
2014-10-10 17:30:24 UTC
Permalink
Post by Zihan, Sheldon Liu
What's the right way to make a RSA public key from two BIGNUM n
(modulus) and e (public exponent)?
RSA* pubKeyRSA = RSA_new();
pubKeyRSA->n = n;
pubKeyRSA->e = e;
This way seems working. But I didn't find it is documented anywhere.
Is there a direct API taking n and e, and returns a RSA*? Thanks.
I don't think there is an official API. I use your method and it works
across many platforms.


______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users-MCmKBN63+***@public.gmane.org
Automated List Manager majordomo-MCmKBN63+***@public.gmane.org
bernard Hauzeur
2014-10-12 19:35:04 UTC
Permalink
An example is documented in the openSSL wiki: http://wiki.openssl.org/index.php/Manual:D2i_RSAPublicKey(3)



BH

From: owner-openssl-users-MCmKBN63+***@public.gmane.org [mailto:owner-openssl-users-MCmKBN63+***@public.gmane.org] On Behalf Of Zihan, Sheldon Liu
Sent: Friday, October 10, 2014 8:27 AM
To: openssl-users-MCmKBN63+***@public.gmane.org
Subject: What's the right way to make a RSA public key from two BIGNUM n and e?



What's the right way to make a RSA public key from two BIGNUM n (modulus) and e (public exponent)?



RSA* pubKeyRSA = RSA_new();

pubKeyRSA->n = n;

pubKeyRSA->e = e;



This way seems working. But I didn't find it is documented anywhere.

Is there a direct API taking n and e, and returns a RSA*? Thanks.
--
Regards,
Zihan, Sheldon Liu
------------------------------------------------
Software Engineer @ Google Inc.
Loading...