[botan-devel] Key craetion error

Seba superpacko at gmail.com
Sun Mar 24 12:48:12 EDT 2013


Hi!

Im having a weird error when creatin a key. I can succesfully encrypt and
decrypt a simple text, but when i try to generate an RSA key it crashes.

Im compiling with Qt Creator, Qt 5.0.1, gcc 4.7.2


    try

    {

        LibraryInitializer init;


        cout << "Hello Botan!" << endl;


        std::cout << "Generate key.." << std::endl;

    Botan::AutoSeeded_RNG rng;

    Botan::Win32_EntropySource entropySource;


    //rng.add_entropy_source(&entropySource);

    //rng.reseed(10096);


    Botan::RSA_PrivateKey rsaPrivate(rng, 1024);


    std::vector<Botan::byte> publicBytes  = Botan::X509::BER_encode(rsaPrivate);

    std::vector<Botan::byte> privateBytes =
Botan::PKCS8::BER_encode(rsaPrivate, rng, "passphrase");

     }

     catch(std::exception& e)

     {

        std::cerr << "Error: " << e.what() << "\n";

     }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.randombit.net/pipermail/botan-devel/attachments/20130324/1ef77133/attachment.html>


More information about the botan-devel mailing list