QOcspResponse Class

This class represents Online Certificate Status Protocol response. More...

Header: #include <QOcspResponse>
qmake: QT += network
Since: Qt 5.13

Public Functions

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

Detailed Description

This class represents Online Certificate Status Protocol response.

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.

See also QSslSocket, QSslSocket::ocspResponses(), certificateStatus(), revocationReason(), responder(), subject(), QOcspCertificateStatus, QOcspRevocationReason, QSslConfiguration::setOcspStaplingEnabled(), QSslConfiguration::ocspStaplingEnabled(), and QSslConfiguration::peerCertificate().

Member Function Documentation

QOcspResponse::QOcspResponse()

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

This function was introduced in Qt 5.13.

See also QOcspCertificateStatus.

QOcspResponse::QOcspResponse(const QOcspResponse &other)

Copy-constructs a QOcspResponse instance.

This function was introduced in Qt 5.13.

QOcspResponse::~QOcspResponse()

Destroys the response.

This function was introduced in Qt 5.13.

QOcspCertificateStatus QOcspResponse::certificateStatus() const

Returns the certificate status.

This function was introduced in Qt 5.13.

See also QOcspCertificateStatus.

QOcspRevocationReason QOcspResponse::revocationReason() const

Returns the reason for revocation.

This function was introduced in Qt 5.13.

QSslCertificate QOcspResponse::subject() const

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

This function was introduced in Qt 5.13.

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

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

This function was introduced in Qt 5.13.

Related Non-Members

enum QOcspCertificateStatus

Describes the Online Certificate Status

ConstantValueDescription
Good0The 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.
Revoked1This state indicates that the certificate has been revoked (either permanently or temporarily - on hold).
Unknown2This state indicates that the responder doesn't know about the certificate being requested.

This enum was introduced or modified in Qt 5.13.

See also QOcspRevocationReason.

enum QOcspRevocationReason

Describes the reason for revocation

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

ConstantValue
None-1
Unspecified0
KeyCompromise1
CACompromise2
AffiliationChanged3
Superseded4
CessationOfOperation5
CertificateHold6
RemoveFromCRL7

This enum was introduced or modified in Qt 5.13.

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

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

This function was introduced in Qt 5.13.