Openssl DER 编码 证书读取

X509* CCertTools::GetX509FromDer(char *filePath)
{
  int content_length = 0;
  char* pContent = FileUtils::ReadFileContent(filePath, content_length);
  char* pTemp = pContent;
  X509* pCert = d2i_X509(NULL, (const unsigned char**)&pTemp, content_length);
  if (pContent!=NULL){
    free(pContent);
    pContent = NULL;
  }
  return pCert;
}

 

posted @ 2013-12-18 10:23  小小亮FLY  阅读(1471)  评论(0编辑  收藏  举报