#include <openssl/md5.h>
#include <openssl/rsa.h>
#include <openssl/pem.h>
#include <string.h>
#include <stdio.h>
#define RSA_KEY_FILE "rsakey.txt"
// > openssl genrsa -out rsakey.txt 1024
int main(void)
{
RSA* rsa = NULL;
FILE* fp = NULL;
if((fp = fopen("sec.pem", "r")) == NULL)
{
fprintf(stderr, "unable to open CAKey file\n");
return;
}
PEM_read_RSAPrivateKey(fp, &rsa, NULL, NULL);
if(rsa == NULL)
{
fprintf(stderr, "rsa is NULL\n");
return;
}
RSA_free(rsa);
}
|Archiver|手机版|小黑屋|软路由
( 渝ICP备15001194号-1|
渝公网安备 50011602500124号 )
GMT+8, 2025-7-12 15:17 , Processed in 0.079717 second(s), 14 queries , Gzip On, Redis On.
Powered by Discuz! X3.5 Licensed
© 2001-2025 Discuz! Team.