このページでは

QSslDiffieHellmanParameters Class

QSslDiffieHellmanParameters クラスは、サーバー向けのディフィー・ヘルマンパラメータ用のインターフェースを提供します。詳細...

ヘッダー: #include <QSslDiffieHellmanParameters>
CMake: find_package(Qt6 REQUIRED COMPONENTS Network)
target_link_libraries(mytarget PRIVATE Qt6::Network)
qmake: QT += network

注:このクラスのすべての関数は再入可能です。

パブリック型

enum Error { NoError, InvalidInputDataError, UnsafeParametersError }

パブリック関数

QSslDiffieHellmanParameters()
QSslDiffieHellmanParameters(const QSslDiffieHellmanParameters &other)
QSslDiffieHellmanParameters(QSslDiffieHellmanParameters &&other)
~QSslDiffieHellmanParameters()
QSslDiffieHellmanParameters::Error error() const
QString errorString() const
bool isEmpty() const
bool isValid() const
void swap(QSslDiffieHellmanParameters &other)
QSslDiffieHellmanParameters &operator=(QSslDiffieHellmanParameters &&other)
QSslDiffieHellmanParameters &operator=(const QSslDiffieHellmanParameters &other)

静的パブリック メンバー

QSslDiffieHellmanParameters defaultParameters()
QSslDiffieHellmanParameters fromEncoded(QIODevice *device, QSsl::EncodingFormat encoding = QSsl::Pem)
QSslDiffieHellmanParameters fromEncoded(const QByteArray &encoded, QSsl::EncodingFormat encoding = QSsl::Pem)
size_t qHash(const QSslDiffieHellmanParameters &key, size_t seed = 0)
bool operator!=(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs)
QDebug operator<<(QDebug debug, const QSslDiffieHellmanParameters &dhparam)
bool operator==(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs)

詳細な説明

QSslDiffieHellmanParameters は、QSslSocket に基づいて、サーバーにディフィー・ヘルマンパラメータを設定するためのインターフェースを提供します。

QSslSocket 、QSslCipher 、およびQSslConfigurationも参照してください 。

メンバ型のドキュメント

enum QSslDiffieHellmanParameters::Error

QSslDiffieHellmanParameters エラーについて説明します。

定数値説明
QSslDiffieHellmanParameters::NoError0エラーは発生しませんでした。
QSslDiffieHellmanParameters::InvalidInputDataError1指定された入力データを使用して、QSslDiffieHellmanParameters オブジェクトを構築できませんでした。
QSslDiffieHellmanParameters::UnsafeParametersError2Diffie-Hellman パラメータは安全ではないため、使用しないでください。

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

QSslDiffieHellmanParameters::QSslDiffieHellmanParameters()

空の QSslDiffieHellmanParameters インスタンスを作成します。

QSslConfiguration オブジェクトに空のQSslDiffieHellmanParametersインスタンスが設定されると、ディフィー・ヘルマンネゴシエーションは無効になります。

isValid() およびQSslConfigurationも参照してください 。

QSslDiffieHellmanParameters::QSslDiffieHellmanParameters(const QSslDiffieHellmanParameters &other)

other の完全なコピーを作成します。

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

other からの移動コンストラクタ。

注: 移動元のオブジェクト other は 、部分的に形成された状態となり、この状態では破棄と新しい値への代入のみが有効な操作となります。

[noexcept] QSslDiffieHellmanParameters::~QSslDiffieHellmanParameters()

QSslDiffieHellmanParameters オブジェクトを破棄します。

[static] QSslDiffieHellmanParameters QSslDiffieHellmanParameters::defaultParameters()

QSslSocket で使用されるデフォルトのQSslDiffieHellmanParameters を返します。

これは現在、RFC 3526に規定された2048ビットのMODPグループです。

[noexcept] QSslDiffieHellmanParameters::Error QSslDiffieHellmanParameters::error() const

QSslDiffieHellmanParameters オブジェクトが無効になった原因となったエラーを返します。

[noexcept] QString QSslDiffieHellmanParameters::errorString() const

QSslDiffieHellmanParameters オブジェクトが無効になった原因となったエラーについて、人間が読みやすい説明を返します。

[static] QSslDiffieHellmanParameters QSslDiffieHellmanParameters::fromEncoded(QIODevice *device, QSsl::EncodingFormat encoding = QSsl::Pem)

encoding で指定されたPEM形式またはDER形式のdevice から読み込み、QSslDiffieHellmanParameters オブジェクトを作成します。

返されたオブジェクトに対してisValid() メソッドを呼び出し、Diffie-Hellman パラメータが有効であり、正しく読み込まれたかどうかを確認してください。

特に、device の値がnullptr である場合や、読み取り用に開かれていない場合は、無効なオブジェクトが返されます。

isValid() およびQSslConfigurationも参照してください 。

[static] QSslDiffieHellmanParameters QSslDiffieHellmanParameters::fromEncoded(const QByteArray &encoded, QSsl::EncodingFormat encoding = QSsl::Pem)

encoding で指定された通り、PEM 形式または DER 形式のバイト配列 `encoded ` を使用して、QSslDiffieHellmanParameters オブジェクトを構築します。

返されたオブジェクトに対してisValid() メソッドを使用することで、ディフィー・ヘルマンパラメータが有効であり、正しく読み込まれたかどうかを確認できます。

isValid() およびQSslConfigurationも参照してください 。

[noexcept] bool QSslDiffieHellmanParameters::isEmpty() const

これが空のQSslDiffieHellmanParameters インスタンスである場合、true を返します。

QSslSocket ベースのサーバーで空の `QSslDiffieHellmanParameters ` インスタンスを設定すると、ディフィー・ヘルマン鍵交換が無効になります。

[noexcept] bool QSslDiffieHellmanParameters::isValid() const

これが有効なQSslDiffieHellmanParameters である場合はtrue を返し、そうでない場合はfalseを返します。

このメソッドは、QSslDiffieHellmanParameters オブジェクトの生成後に、その有効性を確認するために使用する必要があります。

QSslDiffieHellmanParameters オブジェクトが無効な場合は、error() メソッドを使用して、オブジェクトの構築を妨げたエラーを特定できます。

error()も参照してください 。

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

QSslDiffieHellmanParameters をother に置き換えます。この操作は非常に高速で、失敗することはありません。

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

other をこのQSslDiffieHellmanParameters インスタンスに割り当てます。

注: 移動元のオブジェクト other は 、部分的に形成された状態になります。この状態では、有効な操作は破棄と新しい値への代入のみです。

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

other の内容をこのQSslDiffieHellmanParameters にコピーし、2つのQSslDiffieHellmanParameters を同一の状態にします。

この `QSslDiffieHellmanParameters` への参照を返します。

関連する非メンバ関数

[noexcept] size_t qHash(const QSslDiffieHellmanParameters &key, size_t seed = 0)

`key` のハッシュ値を、計算のシードとして `seed ` を使用して返します。

[noexcept] bool operator!=(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs)

lhs がrhs と等しくない場合はtrue を返し、それ以外の場合はfalse を返します。

QDebug operator<<(QDebug debug, const QSslDiffieHellmanParameters &dhparam)

デバッグの目的で、dhparam にあるディフィー・ヘルマンパラメータのセットを、デバッグオブジェクトdebug に書き込みます。

ディフィー・ヘルマンパラメータは、Base64エンコードされたDER形式で表現されます。

「デバッグ手法」も参照してください 。

[noexcept] bool operator==(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs)

lhs がrhs と等しい場合は、true を返します。それ以外の場合は、false を返します。

© 2026 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.