The QHstsPolicy class specifies that a host supports HTTP Strict Transport Security policy (HSTS). More...
Header: | #include <QHstsPolicy> |
qmake: | QT += network |
Since: | Qt 5.9 |
enum | PolicyFlag { IncludeSubDomains } |
flags | PolicyFlags |
QHstsPolicy() | |
QHstsPolicy(const QDateTime &expiry, QHstsPolicy::PolicyFlags flags, const QString &host, QUrl::ParsingMode mode = QUrl::DecodedMode) | |
QHstsPolicy(const QHstsPolicy &other) | |
~QHstsPolicy() | |
QDateTime | expiry() const |
QString | host(QUrl::ComponentFormattingOptions options) const |
bool | includesSubDomains() const |
bool | isExpired() const |
void | setExpiry(const QDateTime &expiry) |
void | setHost(const QString &host, QUrl::ParsingMode mode = QUrl::DecodedMode) |
void | setIncludesSubDomains(bool include) |
void | swap(QHstsPolicy &other) |
QHstsPolicy & | operator=(const QHstsPolicy &other) |
QHstsPolicy & | operator=(QHstsPolicy &&other) |
The QHstsPolicy class specifies that a host supports HTTP Strict Transport Security policy (HSTS).
HSTS policy defines a period of time during which QNetworkAccessManager should only access a host in a secure fashion. HSTS policy is defined by RFC6797.
You can set expiry time and host name for this policy, and control whether it applies to subdomains, either in the constructor or by calling setExpiry(), setHost() and setIncludesSubdomains().
See also QNetworkAccessManager::setStrictTransportSecurityEnabled().
Constant | Value | Description |
---|---|---|
QHstsPolicy::IncludeSubDomains |
1 |
Indicates whether a policy must include subdomains |
The PolicyFlags type is a typedef for QFlags<PolicyFlag>. It stores an OR combination of PolicyFlag values.
Constructs an invalid (expired) policy with empty host name and subdomains not included.
Constructs QHstsPolicy with expiry (in UTC); flags is a value indicating whether this policy must also include subdomains, host data is interpreted according to mode.
See also QUrl::setHost(), QUrl::ParsingMode, and QHstsPolicy::PolicyFlag.
Creates a copy of other object.
Destructor.
Returns the expiration date for the policy (in UTC).
See also setExpiry().
Returns a host for a given policy, formatted according to options.
See also setHost(), QUrl::host(), and QUrl::ComponentFormattingOptions.
Returns true
if this policy also includes subdomains.
See also setIncludesSubDomains().
Return true
if this policy has a valid expiration date and this date is greater than QDateTime::currentGetDateTimeUtc().
See also setExpiry() and expiry().
Sets the expiration date for the policy (in UTC) to expiry.
See also expiry().
Sets a host, host data is interpreted according to mode parameter.
See also host(), QUrl::setHost(), and QUrl::ParsingMode.
Sets whether subdomains are included for this policy to include.
See also includesSubDomains().
Swaps this policy with the other policy.
Copy-assignment operator, makes a copy of other.
Move-assignment operator.