#include <botan/auto_rng.h> <!--more--> #include <botan/rsa.h> #include <botan/pkcs8.h> #include <botan/x509_key.h>
#include <iostream>
int main() { try { Botan::AutoSeeded_RNG rng;
Botan::RSA_PrivateKey private_key(rng, 2048); Botan::RSA_PublicKey public_key = private_key;
std::cout << "Public Key: " << Botan::X509::PEM_encode(public_key) << std::endl; std::cout << "Private Key: " << Botan::PKCS8::PEM_encode(private_key) << std::endl;
} catch (std::exception& e) { std::cerr << "Error: " << e.what() << std::endl; return 1; }
return 0; }
|