The QHstsPolicy class specifies that a host supports HTTP Strict Transport Security policy (HSTS). 更多...
头: | #include <QHstsPolicy> |
qmake: | QT += network |
Since: | Qt 5.9 |
enum | PolicyFlag { IncludeSubDomains } |
flags | PolicyFlags |
QHstsPolicy () | |
QHstsPolicy (const QDateTime & expiry , PolicyFlags flags , const QString & host , QUrl::ParsingMode mode = QUrl::DecodedMode) | |
QHstsPolicy (const QHstsPolicy & other ) | |
~QHstsPolicy () | |
QDateTime | expiry () const |
QString | host (QUrl::ComponentFormattingOptions options = QUrl::FullyDecoded) 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 包括 ) |
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().
另请参阅 QNetworkAccessManager::setStrictTransportSecurityEnabled ().
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): - host data is interpreted according to mode ; - flags selects options to apply to this policy.
另请参阅 QUrl::setHost (), QUrl::ParsingMode ,和 QHstsPolicy::PolicyFlag .
创建副本为 other 对象。
析构函数。
Returns the expiration date for the policy (in UTC).
另请参阅 setExpiry ().
Returns a host for a given policy, formatted according to options .
另请参阅 setHost (), QUrl::host (),和 QUrl::ComponentFormattingOptions .
返回
true
if this policy also includes subdomains.
另请参阅 setIncludesSubDomains ().
返回
true
if this policy has a valid expiration date and this date is greater than QDateTime::currentGetDateTimeUtc().
另请参阅 setExpiry () 和 expiry ().
Sets the expiration date for the policy (in UTC) to expiry .
另请参阅 expiry ().
Sets a host, host data is interpreted according to mode 参数。
另请参阅 host (), QUrl::setHost (),和 QUrl::ParsingMode .
Sets whether subdomains are included for this policy to 包括 .
另请参阅 includesSubDomains ().
Copy-assignment operator, makes a copy of other .
移动赋值运算符。