提供了方法用于通过ca证书的public key验证证书的签名
//verify_cert.hpp
#include <string>
#include <memory>
#include <filesystem>
#include <openssl/pem.h>
using namespace std;
namespace fs = std::filesystem;
class CertVerify{
public:
CertVerify(const fs::path& certFilePath, const fs::path& caFilePath) : m_certFilePath(certFilePath), m_caFilePath(caFilePath) {}
public:
int doVerify()
{
if(m_certFilePath.string().length() == 0 || m_caFilePath.string().length() == 0)
{
return -1;
}
if(!fs::exists(m_certFilePath) || !fs::exists(m_caFilePath))
{
return -2;
}
shared_ptr<BIO> certBio(BIO_new_fil