byte cacertfid[] = { 0x00, 0xa0 };
char certBuf[1024*5];
int certLen = 1024;
ret = XKF_ReadCert(handle, (unsigned char*)cacertfid, (unsigned char*)certBuf, &certLen);//读取ca证书的接口
long len = 1024;
X509 *cert = X509_new();
cert = d2i_X509(&cert,(unsigned char **)&certBuf, len);//程序运行到这儿报错如下图
if (!cert) {
fprintf(stderr, "unable to parse certificate in memory\n");
return EXIT_FAILURE;
}
我想根据读取证书的Buff去获取x509的对象,然后再获取其公钥,到这里就出问题了,求解。。