QOcspResponse Class

This class represents Online Certificate Status Protocol response. 更多...

头: #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= (const QOcspResponse & other )
QOcspResponse & operator= (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 )

详细描述

The QOcspResponse class represents the revocation status of a server's certificate, received by the client-side socket during the TLS handshake. QSslSocket must be configured with OCSP stapling enabled.

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

成员函数文档编制

QOcspResponse:: QOcspResponse ()

Creates a new response with status QOcspCertificateStatus::Unknown and revocation reason QOcspRevocationReason::None .

另请参阅 QOcspCertificateStatus .

QOcspResponse:: QOcspResponse (const QOcspResponse & other )

Copy-constructs a QOcspResponse instance.

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

Move-constructs a QOcspResponse instance.

[noexcept] QOcspResponse:: ~QOcspResponse ()

Destroys the response.

QOcspCertificateStatus QOcspResponse:: certificateStatus () const

Returns the certificate status.

另请参阅 QOcspCertificateStatus .

class QSslCertificate QOcspResponse:: responder () const

This function returns a certificate used to sign OCSP response.

QOcspRevocationReason QOcspResponse:: revocationReason () const

Returns the reason for revocation.

QSslCertificate QOcspResponse:: subject () const

This function returns a certificate, for which this response was issued.

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

Swaps this response with other .

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

Copy-assigns other and returns a reference to this response.

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

移动赋值 other 到此 QOcspResponse 实例。

相关非成员

enum class QOcspCertificateStatus

描述在线证书状态

常量 描述
QOcspResponse::QOcspCertificateStatus::Good 0 The certificate is not revoked, but this does not necessarily mean that the certificate was ever issued or that the time at which the response was produced is within the certificate's validity interval.
QOcspResponse::QOcspCertificateStatus::Revoked 1 This state indicates that the certificate has been revoked (either permanently or temporarily - on hold).
QOcspResponse::QOcspCertificateStatus::Unknown 2 This state indicates that the responder doesn't know about the certificate being requested.

另请参阅 QOcspRevocationReason .

enum class QOcspRevocationReason

描述撤销的原因

This enumeration describes revocation reasons, defined in RFC 5280, section 5.3.1

常量
QOcspResponse::QOcspRevocationReason::None -1
QOcspResponse::QOcspRevocationReason::Unspecified 0
QOcspResponse::QOcspRevocationReason::KeyCompromise 1
QOcspResponse::QOcspRevocationReason::CACompromise 2
QOcspResponse::QOcspRevocationReason::AffiliationChanged 3
QOcspResponse::QOcspRevocationReason::Superseded 4
QOcspResponse::QOcspRevocationReason::CessationOfOperation 5
QOcspResponse::QOcspRevocationReason::CertificateHold 6
QOcspResponse::QOcspRevocationReason::RemoveFromCRL 7

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

返回 true if lhs and rhs are responses for different certificates, or signed by different responders, or have different revocation reasons, or different certificate statuses.

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

返回 true if lhs and rhs are the responses for the same certificate, signed by the same responder, have the same revocation reason and the same certificate status.