- Qt 6.8
- Qt Network
- C++ Classes
- QSslEllipticCurve
- Qt 6.8.3 Reference Documentation

# QSslEllipticCurve Class

Represents an elliptic curve for use by elliptic-curve cipher algorithms. More...

Header: | `#include <QSslEllipticCurve>`
CMake: | `find_package(Qt6 REQUIRED COMPONENTS Network)` `target_link_libraries(mytarget PRIVATE Qt6::Network)`
qmake: | `QT += network`

- List of all members, including inherited members
- QSslEllipticCurve is part of Network Programming API.

Note: All functions in this class are reentrant.

## Public Functions

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

## Static Public Members

QSslEllipticCurve | fromLongName(const QString &name)
QSslEllipticCurve | fromShortName(const QString &name)

## Related Non-Members

bool | operator!=(QSslEllipticCurve lhs, QSslEllipticCurve rhs)
QDebug | operator<<(QDebug debug, QSslEllipticCurve curve)
bool | operator==(QSslEllipticCurve lhs, QSslEllipticCurve rhs)

## Detailed Description

The class QSslEllipticCurve represents an elliptic curve for use by elliptic-curve cipher algorithms.

Elliptic curves can be constructed from a "short name" (SN) (fromShortName()), and by a call to QSslConfiguration::supportedEllipticCurves().

QSslEllipticCurve instances can be compared for equality and can be used as keys in QHash and QSet. They cannot be used as key in a QMap.

Note: This class is currently only supported in OpenSSL.

## Member Function Documentation

### `[constexpr noexcept]` QSslEllipticCurve::QSslEllipticCurve()

Constructs an invalid elliptic curve.

See also isValid() and QSslConfiguration::supportedEllipticCurves().

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

Returns an QSslEllipticCurve instance representing the named curve name. The name is a long name for the curve, whose exact spelling depends on the SSL implementation.

If the given name is not supported, returns an invalid QSslEllipticCurve instance.

Note: The OpenSSL implementation of this function treats the name case-sensitively.

See also longName().

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

Returns an QSslEllipticCurve instance representing the named curve name. The name is the conventional short name for the curve, as represented by RFC 4492 (for instance `secp521r1`), or as NIST short names (for instance `P-256`). The actual set of recognized names depends on the SSL implementation.

If the given name is not supported, returns an invalid QSslEllipticCurve instance.

Note: The OpenSSL implementation of this function treats the name case-sensitively.

See also shortName().

### `[noexcept]` bool QSslEllipticCurve::isTlsNamedCurve() const

Returns true if this elliptic curve is one of the named curves that can be used in the key exchange when using an elliptic curve cipher with TLS; false otherwise.

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

Returns true if this elliptic curve is a valid curve, false otherwise.

### QString QSslEllipticCurve::longName() const

Returns the conventional long name for this curve. If this curve is invalid, returns an empty string.

See also shortName().

### QString QSslEllipticCurve::shortName() const

Returns the conventional short name for this curve. If this curve is invalid, returns an empty string.

See also longName().

## Related Non-Members

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

Returns true if the curve lhs represents a different curve than rhs; false otherwise.

### QDebug operator<<(QDebug debug, QSslEllipticCurve curve)

Writes the elliptic curve curve into the debug object debug for debugging purposes.

See also Debugging Techniques.

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

Returns true if the curve lhs represents the same curve of rhs;