If I understand you correctly, no. It is an essential feature of public key encryption that neither key can be computed from the other.

That's incorrect. You can usually obtain a public key from a private key, but not vice versa. To do this in Crypto++:


// untested
std::string hexEncodedPrivateKey;
//...
StringSource ss(hexEncodedPrivateKey, true, new HexDecoder);
RSA::PrivateKey priv;
priv.BERDecode(ss);
RSA::PublicKey pub;
pub.AssignFrom(priv);



Reply via email to