Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* *Generate RSA-Keys and building the ASN.1v8 structure of the x.509 certificate */
- /* *Using Crypto++ */
- #include <osrng.h>
- #include <rsa.h>
- #include <files.h>
- #include <sstream>
- using namespace CryptoPP;
- using std::stringstream;
- AutoSeededRandomPool AutoSeedGen;
- RSA::PrivateKey RSA_PrivKey;
- stringstream output;
- RSA_PrivKey.Initialize(AutoSeedGen,1024,65537);
- RSA::PublicKey RSA_PublicKey(RSA_PrivKey);
- _RSA_PublicKey->Save(FileSink(output));
- output.str() //Contains the ASN.1 structure of the x.509 certificate
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement