QOcspResponse Class

This class represents Online Certificate Status Protocol response. \since 5.13. More...

Header: #include <QOcspResponse>

Public Functions

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)

Detailed Description

\ingroupnetwork \ingroup ssl \inmodule QtNetwork

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()

\since5.13

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

See also QOcspCertificateStatus.

QOcspResponse::QOcspResponse(const QOcspResponse &other)

\since5.13

Copy-constructs a QOcspResponse instance.

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

\since5.13

Move-constructs a QOcspResponse instance.

[noexcept] QOcspResponse::~QOcspResponse()

\since5.13

Destroys the response.

QOcspCertificateStatus QOcspResponse::certificateStatus() const

\since5.13

Returns the certificate status.

See also QOcspCertificateStatus.

class QSslCertificate QOcspResponse::responder() const

\since5.13

This function returns a certificate used to sign OCSP response.

QOcspRevocationReason QOcspResponse::revocationReason() const

\since5.13

Returns the reason for revocation.

QSslCertificate QOcspResponse::subject() const

\since5.13

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

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

\since5.13

Swaps this response with other.

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

\since5.13

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

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

\since5.13

Move-assigns other to this QOcspResponse instance.

Related Non-Members

enum class QOcspCertificateStatus

Describes the Online Certificate Status \since 5.13

\ingroupnetwork \ingroup ssl \inmodule QtNetwork

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

See also QOcspRevocationReason.

enum class QOcspRevocationReason

Describes the reason for revocation \since 5.13

\ingroupnetwork \ingroup ssl \inmodule QtNetwork

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

ConstantValue
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)

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.

\since5.13

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

Returns 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.

\since5.13