QOcspResponse Class

该类表示联机证书状态协议响应。更多

头文件: #include <QOcspResponse>
CMake: find_package(Qt6 REQUIRED COMPONENTS Network)
target_link_libraries(mytarget PRIVATE Qt6::Network)
qmake: QT += network

公共函数

QOcspResponse()
QOcspResponse(const QOcspResponse &other)
QOcspResponse(QOcspResponse &&other)
~QOcspResponse()
QOcspCertificateStatus certificateStatus() const
class QSslCertificate responder() const
QOcspRevocationReason revocationReason() const
QSslCertificate subject() const
void swap(QOcspResponse &other)
QOcspResponse &operator=(QOcspResponse &&other)
QOcspResponse &operator=(const QOcspResponse &other)
enum class QOcspCertificateStatus { Good, Revoked, Unknown }
enum class QOcspRevocationReason { None, Unspecified, KeyCompromise, CACompromise, AffiliationChanged, …, RemoveFromCRL }
bool operator!=(const QOcspResponse &lhs, const QOcspResponse &rhs)
bool operator==(const QOcspResponse &lhs, const QOcspResponse &rhs)

详细说明

QOcspResponse 类表示客户端套接字在 TLS 握手过程中收到的服务器证书的吊销状态。QSslSocket 必须配置为启用 OCSP stapling。

另请参阅 QSslSocket,QSslSocket::ocspResponses(),certificateStatus(),revocationReason(),responder(),subject(),QOcspCertificateStatus,QOcspRevocationReason,QSslConfiguration::setOcspStaplingEnabled(),QSslConfiguration::ocspStaplingEnabled() 和QSslConfiguration::peerCertificate() 。

成员函数文档

QOcspResponse::QOcspResponse()

创建一个新的响应,状态为QOcspCertificateStatus::Unknown ,撤销原因为QOcspRevocationReason::None

另请参阅 QOcspCertificateStatus

QOcspResponse::QOcspResponse(const QOcspResponse &other)

复制-构建一个 QOcspResponse 实例。

[noexcept] QOcspResponse::QOcspResponse(QOcspResponse &&other)

移动-构建 QOcspResponse 实例。

[noexcept] QOcspResponse::~QOcspResponse()

破坏响应。

QOcspCertificateStatus QOcspResponse::certificateStatus() const

返回证书状态。

另请参阅 QOcspCertificateStatus

class QSslCertificate QOcspResponse::responder() const

此函数返回用于签署 OCSP 响应的证书。

QOcspRevocationReason QOcspResponse::revocationReason() const

返回撤销的原因。

QSslCertificate QOcspResponse::subject() const

该函数返回一个证书,此响应是为该证书发出的。

[noexcept] void QOcspResponse::swap(QOcspResponse &other)

将此响应与other 互换。该操作速度非常快,从未出现过故障。

[noexcept] QOcspResponse &QOcspResponse::operator=(QOcspResponse &&other)

Move-assignsother 到此QOcspResponse 实例。

QOcspResponse &QOcspResponse::operator=(const QOcspResponse &other)

复制-分配other 并返回对该响应的引用。

相关非会员

enum class QOcspCertificateStatus

描述在线证书状态

常数说明
QOcspResponse::QOcspCertificateStatus::Good0证书未被吊销,但这并不一定意味着证书曾经签发过,也不意味着生成响应的时间在证书有效期内。
QOcspResponse::QOcspCertificateStatus::Revoked1此状态表示证书已被撤销(永久或临时--搁置)。
QOcspResponse::QOcspCertificateStatus::Unknown2此状态表示应答者不知道所请求的证书。

另请参阅 QOcspRevocationReason

enum class QOcspRevocationReason

描述撤销原因

该枚举描述了RFC 5280 第 5.3.1 节中定义的撤销原因

常量
QOcspResponse::QOcspRevocationReason::None-1
QOcspResponse::QOcspRevocationReason::Unspecified0
QOcspResponse::QOcspRevocationReason::KeyCompromise1
QOcspResponse::QOcspRevocationReason::CACompromise2
QOcspResponse::QOcspRevocationReason::AffiliationChanged3
QOcspResponse::QOcspRevocationReason::Superseded4
QOcspResponse::QOcspRevocationReason::CessationOfOperation5
QOcspResponse::QOcspRevocationReason::CertificateHold6
QOcspResponse::QOcspRevocationReason::RemoveFromCRL7

bool operator!=(const QOcspResponse &lhs, const QOcspResponse &rhs)

如果lhsrhs 是对不同证书的回应,或由不同的回应者签署,或有不同的撤销原因,或证书状态不同,则返回true

bool operator==(const QOcspResponse &lhs, const QOcspResponse &rhs)

如果lhsrhs 是对同一证书的回应,由同一回应者签署,具有相同的撤销原因和相同的证书状态,则返回true

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.