您的位置:首页 > 运维架构

openssl 验证证书是否是某个CA证书签发

2011-02-23 11:56 405 查看
int VerifyCertByIssuer(X509 *cert, X509 *issuer)
{
int res = 0;
EVP_PKEY *pubkey = 0;
if (X509_check_issued(issuer, cert) != X509_V_OK)
{
goto end;
}
pubkey = X509_get_pubkey(issuer);
if (!X509_verify(cert, pubkey))
{
goto end;
}
res = 1;
end:
if (pubkey)
{
EVP_PKEY_free(pubkey);
}
return res;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: