title: Import RSA public/private key from a string Crypto++
body: <p>I would like to import a RSA key directly from a string variable, to use it with Crypto++library.</p>
  
  <p>The code would look like this:
  It is an example of what I want to do,not a working code.
  </p>
  
  <pre><code>std::string publickey_str =
      "-----BEGIN PUBLIC KEY-----"
      "gm6mZA1NTZQJVUk9AGDb6NRngzRlRAgXBTWAispwlqsuHFoCrv02xPm1uxkLyfUq"
      "LoA4/EQJ25okjmGkrjgak+XmQIPKmAg94gWAtvRIrLZNmCj/aPeuikmCPXkKtg2b"
      "pdB6xzHY0ftGu0l6Vb8zttg7Wfo1kJowjoqCRwo9ex/IKwPXxE3UsugshcZOGdqT"
      "6E3B/Vw+JoerL/LfeOU2OYcSFEXsWqjzkrGzEVuKzRnve5RlXyY0gShP33f+hDnC"
      "F+Uu2tFfFgxRkdQPk7AKm4MCAwEAAQ=="
      "-----END PUBLIC KEY-----";
  
  RSA::PublicKey publicKey;
  publicKey.load(publickey_str);
  </code></pre>
  
  <p>In the Crypto++ wiki, I only find how to import/export keys from/to files (.der, .pem). Do you know how can i do the same thing with a string ?</p>
  
  <p>Edit: i apologize,i forgot to tell that i shortened the RSA public key for the example.</p>