Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- RAND_load_file("/dev/urandom", 1024);
- OpenSSL_add_all_algorithms();
- rsaKey = RSA_generate_key(1024, 65537, NULL, NULL);
- RSA_blinding_on(rsaKey, NULL);
- BIO *bio = BIO_new(BIO_s_mem());
- //Start input thread
- i2d_RSAPublicKey_bio(bio, rsaKey);
- BUF_MEM *mem = NULL;
- BIO_get_mem_ptr(bio, &mem);
- BIO_set_close(bio, BIO_NOCLOSE);
- BIO_free(bio);
- char* data = mem->data;
- int length = mem->length;
- ASN1PUBKEY = new QByteArray(data, length);
- ConsoleLogger::fine("RSA key created!");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement