#include <openssl/rsa.h> int PEM_write_RSAPublicKey(FILE* fp,const RSA* r); int PEM_write_RSAPrivateKey(FILE* fp,const RSA* r,const EVP_CIPHER* enc, unsigned char* kstr,int klen,pem_password_cb* cb,void* u); 参数: - fp: 需要打开一个磁盘文件,并且指定写权限 - r: 存储了密钥对 /////////////// - 私钥独有的参数 - enc: 指定的加密算法 -> 堆成加密 -> NULL - kstr: 对称加密的密钥 -> NULL - klen: 密钥长度 -> 0 - cb:回调函数,用不到,NULL - u: 给回调传参,用不到,NULL