SHARE
TWEET

Gen RSA-Keys + building ASN.1v8 structure of x.509 cert

Sprenger120 Jul 31st, 2012 884 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* *Generate RSA-Keys and building the ASN.1v8 structure of the x.509 certificate */
  2. /* *Using Crypto++ */
  3. #include <osrng.h>
  4. #include <rsa.h>
  5. #include <files.h>
  6. #include <sstream>
  7. using namespace CryptoPP;
  8. using std::stringstream;
  9.  
  10. AutoSeededRandomPool AutoSeedGen;
  11. RSA::PrivateKey RSA_PrivKey;
  12. stringstream output;
  13.  
  14. RSA_PrivKey.Initialize(AutoSeedGen,1024,65537);
  15.  
  16.  
  17. RSA::PublicKey RSA_PublicKey(RSA_PrivKey);
  18. _RSA_PublicKey->Save(FileSink(output));
  19.  
  20.  
  21. output.str() //Contains the ASN.1 structure of the x.509 certificate
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top