[Botan-devel] RSA Public Key

Theodore Smith hopeseekr at gmail.com
Wed Aug 3 16:13:37 EDT 2005

Sorry, I *just* subscribed to this list, and so I cannot reply adequately. 
The question I seek to answwer is

>* How can obtain a RSA_PublicKey from a RSA_PrivateKey??
*>* If I call  aprivatekey=new RSA_PrivateKey(len) how can I call the
*>* RSA_PublicKey constructor to obtain a RSA public key??*

Unfortunately, Jack Loyd's reponse had a few problems in that it would not 
compile for me. I, however, have had this same exact problem today, and I 
just solved it. Here is my solution:

// Assumes m_private_key is a fully valid + existing key.
RSA_PrivateKey* m_private_key;
RSA_PublicKey* m_public_key;

m_public_key = new RSA_PublicKey(*m_private_key);

That should work...

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.randombit.net/pipermail/botan-devel/attachments/20050803/9a6fbc11/attachment.html>

More information about the botan-devel mailing list