如何使用Openssl加载证书撤销列表
下面给出一种使用Openssl加载证书撤销列表的方法,该方法只能加载Pem格式的证书撤销列表
- #include <openssl/bio.h>
- #include <openssl/x509.h>
- #include <openssl/pem.h>
- #include <iostream>
- using namespace std;
- void main()
- {
- X509_CRL *m_crl = NULL;
- BIO *bio = NULL;
- bio=BIO_new_file("crlTestPem.crl", "r");
- if (bio == NULL)
- {
- cout<<"bio null"<<endl;
- }
- m_crl=PEM_read_bio_X509_CRL(bio,NULL,NULL,NULL);
- if (m_crl == NULL)
- {
- cout<<"null"<<endl;
- }
- else
- {
- cout<<"success"<<endl;
- }
- }