QSslEllipticCurve Class

代表椭圆曲线,供椭圆曲线密码算法使用。更多

头文件: #include <QSslEllipticCurve>
CMake: find_package(Qt6 REQUIRED COMPONENTS Network)
target_link_libraries(mytarget PRIVATE Qt6::Network)
qmake: QT += network

注意:该类中的所有函数都是可重入的

公共函数

QSslEllipticCurve()
bool isTlsNamedCurve() const
bool isValid() const
QString longName() const
QString shortName() const

静态公共成员

QSslEllipticCurve fromLongName(const QString &name)
QSslEllipticCurve fromShortName(const QString &name)
bool operator!=(QSslEllipticCurve lhs, QSslEllipticCurve rhs)
QDebug operator<<(QDebug debug, QSslEllipticCurve curve)
bool operator==(QSslEllipticCurve lhs, QSslEllipticCurve rhs)

详细说明

QSslEllipticCurve 类表示椭圆曲线,供椭圆曲线密码算法使用。

椭圆曲线可由 "简短名称"(SN)(fromShortName()) 和调用QSslConfiguration::supportedEllipticCurves() 构建。

QSslEllipticCurve 实例可进行相等性比较,并可在QHashQSet 中用作密钥。它们不能用作QMap 中的密钥。

注: 该类目前仅在 OpenSSL 中受支持。

成员函数文档

[constexpr noexcept] QSslEllipticCurve::QSslEllipticCurve()

构造一条无效的椭圆曲线。

另请参阅 isValid() 和QSslConfiguration::supportedEllipticCurves() 。

[static] QSslEllipticCurve QSslEllipticCurve::fromLongName(const QString &name)

返回一个QSslEllipticCurve 实例,表示已命名的曲线namename 是曲线的长名称,具体拼写取决于 SSL 实现。

如果不支持给定的name ,则返回一个无效的QSslEllipticCurve 实例。

注意: 该函数的 OpenSSL 实现对名称的大小写敏感。

另请参阅 longName().

[static] QSslEllipticCurve QSslEllipticCurve::fromShortName(const QString &name)

返回一个代表已命名曲线nameQSslEllipticCurve 实例。name 是曲线的常规简称,如 RFC 4492 所示(如secp521r1 )或 NIST 的简称(如P-256 )。实际的识别名称取决于 SSL 实现。

如果不支持给定的name ,则返回无效的QSslEllipticCurve 实例。

注: 该函数的 OpenSSL 实现对名称的大小写敏感。

另请参阅 shortName() 。

[noexcept] bool QSslEllipticCurve::isTlsNamedCurve() const

如果该椭圆曲线是在 TLS 中使用椭圆曲线密码时可用于密钥交换的指定曲线之一,则返回 true;否则返回 false。

[constexpr noexcept] bool QSslEllipticCurve::isValid() const

如果该椭圆曲线是有效曲线,则返回 true,否则返回 false。

QString QSslEllipticCurve::longName() const

返回此曲线的常规长名称。如果该曲线无效,则返回空字符串。

另请参阅 shortName()。

QString QSslEllipticCurve::shortName() const

返回此曲线的常规简称。如果该曲线无效,则返回空字符串。

另请参阅 longName()。

相关非成员

[constexpr noexcept] bool operator!=(QSslEllipticCurve lhs, QSslEllipticCurve rhs)

如果lhs 代表的曲线与rhs 不同,则返回 true;否则返回 false。

QDebug operator<<(QDebug debug, QSslEllipticCurve curve)

将椭圆曲线curve 写入调试对象debug ,用于调试。

另请参阅 调试技巧

[constexpr noexcept] bool operator==(QSslEllipticCurve lhs, QSslEllipticCurve rhs)

如果lhs 代表与rhs 相同的曲线,则返回 true;

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