QMaskGenerator Class

QMaskGeneratorクラスは、カスタム32ビット・マスク・ジェネレータの抽象ベースを提供します。詳細...

ヘッダー #include <QMaskGenerator>
CMake: find_package(Qt6 REQUIRED COMPONENTS WebSockets)
target_link_libraries(mytarget PRIVATE Qt6::WebSockets)
qmake: QT += websockets
継承: QObject

パブリック関数

QMaskGenerator(QObject *parent = nullptr)
virtual ~QMaskGenerator() override
virtual quint32 nextMask() = 0
virtual bool seed() = 0

詳細説明

RFC 6455で概説されている WebSockets の仕様では、クライアントからサーバーへの通信はすべてマスクされる必要がある。これは、悪意のあるスクリプトが動作の悪いプロキシを攻撃するのを防ぐためである。優れたマスキングの重要性については、Lin-Shung Huangらによる "Talking to Yourself for Fun and Profit "を参照のこと。デフォルトでは、QWebSocket 、そこそこ安全なQRandomGenerator::global()->generate()関数を使用する。上記の文書で言及されている攻撃に対する最善の対策は、安全な接続(wss://)で QWebSocket を使用することである。一般的に、アプリケーション内でサードパーティのスクリプトがQWebSocket にアクセスしないように常に注意してください。

メンバー関数ドキュメント

[explicit] QMaskGenerator::QMaskGenerator(QObject *parent = nullptr)

与えられたオプションQObject parent で新しい QMaskGenerator オブジェクトを作成します。

[override virtual noexcept] QMaskGenerator::~QMaskGenerator()

QMaskGenerator オブジェクトを破棄する。

[pure virtual] quint32 QMaskGenerator::nextMask()

新しいランダムな32ビットマスクを返す。乱数度はマスクの作成に使用したRNGに依存する。

[pure virtual] bool QMaskGenerator::seed()

QMaskGenerator を初期化します。seed() がコールされない場合、デフォルトのシードが使用されるか、シードがまったく使用されないかは、サブクラスの特定の実装に依存します。seedが成功した場合はtrueを返し、そうでない場合はfalseを返します。

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.