How to print RSA* as string in C++?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: How to properly print RSA* as string in C++? I am using OpenSSL . It doesn't seem to have a .c_str() method, right? 回答1: RSA_print_fp(stdout, x, 0); http://linux.die.net/man/3/rsa_print_fp 回答2: #include <iostream> using std::cout; using std::endl; #include <string> using std::string; #include <memory> using std::unique_ptr; #include <openssl/bn.h> #include <openssl/rsa.h> #include <openssl/bio.h> #include <openssl/buffer.h> #include <cassert> #define ASSERT assert using BN_ptr = std::unique_ptr<BIGNUM, decltype(&::BN_free)>; using RSA_ptr =