void RSAPackage::generateKey(const unsigned int keyLen, const std::string &seed, std::string &strPriv, std::string &strPub)
{
RandomPool randPool;
randPool.IncorporateEntropy((byte *)seed.c_str(), strlen(seed.c_str()));
RSAES_OAEP_SHA_Decryptor priv(randPool, keyLen);
HexEncoder privFile(new StringSink(strPriv));
priv.DEREncode(privFile);
privFile.MessageEnd();
RSAES_OAEP_SHA_Encryptor pub(priv);
HexEncoder pubFile(new StringSink(strPub));
pub.DEREncode(pubFile);
pubFile.MessageEnd();
}
求解如何控制RSA生成的公钥和私钥的长度,至少可以控制公钥就好了
不知道参数该如何传 跪求![](http://tb2.bdstatic.com/tb/editor/images/face/i_f30.png?t=20140803)
{
RandomPool randPool;
randPool.IncorporateEntropy((byte *)seed.c_str(), strlen(seed.c_str()));
RSAES_OAEP_SHA_Decryptor priv(randPool, keyLen);
HexEncoder privFile(new StringSink(strPriv));
priv.DEREncode(privFile);
privFile.MessageEnd();
RSAES_OAEP_SHA_Encryptor pub(priv);
HexEncoder pubFile(new StringSink(strPub));
pub.DEREncode(pubFile);
pubFile.MessageEnd();
}
求解如何控制RSA生成的公钥和私钥的长度,至少可以控制公钥就好了
不知道参数该如何传 跪求
![](http://tb2.bdstatic.com/tb/editor/images/face/i_f30.png?t=20140803)