?可以通過(guò)openssl提供的庫(kù)函數(shù)驗(yàn)證
Linux(openssl):創(chuàng)建selfsign證書(shū)-CSDN博客文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-740598.html
生成的正式是否為selfsign?文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-740598.html
//check_cert.hpp
#include <string>
#include <memory>
#include <filesystem>
#include <openssl/pem.h>
using namespace std;
namespace fs = std::filesystem;
class CheckSelfsign{
public:
CheckSelfsign(const fs::path& filePath) : m_filePath(filePath) {}
public:
int doCheck()
{
if(m_filePath.string().length() > 0)
{
if(fs::exists(m_filePath))
{
shared_ptr<BIO> certBio(BIO_new_file(m_filePath.string().c_str(), "rb"), ::BIO_free);
if(certBio == nullptr)
{
return -2;
}
到了這里,關(guān)于Linux(openssl):通過(guò)編程檢查證書(shū)是否為selfsign的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!