幻想小说网 酷文学 深夜书屋 叮当小说网 找小说网 无限小说网 红尘小说网

如何使用Openssl加载证书撤销列表

 下面给出一种使用Openssl加载证书撤销列表的方法,该方法只能加载Pem格式的证书撤销列表

  1. #include <openssl/bio.h>
  2. #include <openssl/x509.h>
  3. #include <openssl/pem.h>
  4. #include <iostream>
  5. using namespace std;
  6. void main()
  7. {
  8.     X509_CRL  *m_crl = NULL;
  9.     BIO     *bio = NULL;
  10.     bio=BIO_new_file("crlTestPem.crl""r");
  11.     if (bio == NULL)
  12.     {
  13.         cout<<"bio null"<<endl;
  14.     }
  15.     m_crl=PEM_read_bio_X509_CRL(bio,NULL,NULL,NULL);
  16.     if (m_crl == NULL)
  17.     {
  18.         cout<<"null"<<endl;
  19.     }
  20.     else
  21.     {
  22.         cout<<"success"<<endl;
  23.     }
  24. }

posted on 2008-12-03 14:34  张云临  阅读(441)  评论(0编辑  收藏  举报

导航