PEM_read_RSA_PUBKEY返回并中断应用程序
PEM_read_RSA_PUBKEY returns and breaks the app
我正在尝试使用RSA
来使用OpenSSL
加密一些内容。
RSA *rsaPubKey = RSA_new();
FILE *file;
file = fopen("PubKey.pem","r");
if(file){
rsaPubKey = PEM_read_RSA_PUBKEY(file, &rsaPubKey ,NULL,NULL);
}
.......... //some stuff
return 0
在执行PEM_read_RSA_PUBKEY
之后,应用程序被终止,没有任何错误。我不知道怎么了!!
我在一个旧项目中使用了以下代码:
BIO *bioPub = BIO_new_file(pubkeyPath, "r");
RSA *pubkey = PEM_read_bio_PUBKEY(bioPub, NULL, NULL, NULL);
/* do some stuff */
RSA_free(pubkey);
BIO_free(bioPub);
你试过下面的吗?
FILE *file = fopen("PubKey.pem","r");
RSA *rsaPubKey = PEM_read_RSA_PUBKEY(file, NULL, NULL, NULL);
相关文章:
- 试图在visual studio上用C++创建一个桌面应用程序
- FFmpeg:制作一个应用程序比直接使用ffmepg更好吗
- 在C应用程序中运行C++(带有STL)函数
- 使用VerQueryValue检索应用程序的文件描述
- Qt C++静态thread_local QNetworkAccessManager是线程应用程序的好选择吗
- 使用调试/崩溃报告将应用程序部署到客户端
- C++控制台应用程序阻止退出
- 多线程应用程序中的零MQ处理中断
- 当我跳到应用程序时,中断无法工作(STM32)
- 如何中断嵌入C++应用程序中的python解释器
- 如何在运行 cpp 应用程序的 GUI 时通过 GDB 设置中断
- Stockfish 引擎在从视图控制器而不是应用程序委托 iOS 加载时中断
- 将 INT3 中断保留给视觉工作室上的应用程序异常处理程序
- PEM_read_RSA_PUBKEY返回并中断应用程序
- 如何在Linux应用程序上使用C++中的终端输入中断循环/进程
- QT创建者:c++应用程序运行几次后中断
- Qt5:如何创建基于qt应用程序中断驱动的gpio按钮
- 在服务器应用程序中处理中断信号的最佳方式
- Pageheap 不会使我的应用程序中断
- linux多线程应用程序中的中断会生成SIGSEGV