QKnxNetIpSecureConfiguration Class

The QKnxNetIpSecureConfiguration class holds configuration options used for the secure session authentication process. 更多...

头: #include <QKnxNetIpSecureConfiguration>
qmake: QT += knx
Since: Qt 5.13

该类在 Qt 5.13 引入。

公共类型

enum class Type { Tunneling, DeviceManagement }

公共函数

QKnxNetIpSecureConfiguration (QKnxNetIpSecureConfiguration && other )
QKnxNetIpSecureConfiguration (const QKnxNetIpSecureConfiguration & other )
QKnxNetIpSecureConfiguration ()
QKnxNetIpSecureConfiguration & operator= (QKnxNetIpSecureConfiguration && other )
QKnxNetIpSecureConfiguration & operator= (const QKnxNetIpSecureConfiguration & other )
~QKnxNetIpSecureConfiguration ()
QByteArray deviceAuthenticationCode () const
QKnxAddress host () const
QKnxAddress individualAddress () const
bool isNull () const
bool isSecureSessionKeepAliveSet () const
bool isValid () const
QKnxSecureKey privateKey () const
QKnxSecureKey publicKey () const
bool setDeviceAuthenticationCode (const QByteArray & authenticationCode )
void setHost (const QKnxAddress & hostAddress )
bool setIndividualAddress (const QKnxAddress & address )
void setKeepSecureSessionAlive (bool keepAlive )
bool setPrivateKey (const QKnxSecureKey & key )
bool setUserId (QKnxNetIp::SecureUserId userId )
void setUserPassword (const QByteArray & userPassword )
void swap (QKnxNetIpSecureConfiguration & other )
QKnxNetIp::SecureUserId userId () const
QByteArray userPassword () const
bool operator!= (const QKnxNetIpSecureConfiguration & other ) const
bool operator== (const QKnxNetIpSecureConfiguration & other ) const

静态公共成员

QVector<QKnxNetIpSecureConfiguration> fromKeyring (QKnxNetIpSecureConfiguration::Type type , const QString & keyring , const QByteArray & password , bool validate )
QKnxNetIpSecureConfiguration fromKeyring (QKnxNetIpSecureConfiguration::Type type , const QKnxAddress & ia , const QString & keyring , const QByteArray & password , bool validate )

详细描述

It holds information such as secure key, user ID and password, device authentication code, and so on.

This class is part of the Qt KNX module and currently available as a Technology Preview, and therefore the API and functionality provided by the class may be subject to change at any time without prior notice.

成员类型文档编制

enum class QKnxNetIpSecureConfiguration:: Type

This enum holds the type of secure configuration that can be constructed from an ETS exported keyring (*.knxkeys) file.

常量 描述
QKnxNetIpSecureConfiguration::Type::Tunneling 0x00 KNXnet/IP secure tunneling configuration.
QKnxNetIpSecureConfiguration::Type::DeviceManagement 001 KNXnet/IP secure device management configuration.

成员函数文档编制

QKnxNetIpSecureConfiguration:: QKnxNetIpSecureConfiguration ( QKnxNetIpSecureConfiguration && other )

Move-constructs a secure configuration, making it point to the same secure configuration that other 所指向的。

QKnxNetIpSecureConfiguration:: QKnxNetIpSecureConfiguration (const QKnxNetIpSecureConfiguration & other )

构造副本为 other .

QKnxNetIpSecureConfiguration:: QKnxNetIpSecureConfiguration ()

Constructs a new, empty, invalid secure configuration.

另请参阅 isNull () 和 isValid ().

QKnxNetIpSecureConfiguration &QKnxNetIpSecureConfiguration:: operator= ( QKnxNetIpSecureConfiguration && other )

移动赋值 other to this secure configuration.

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

赋值指定 other to this secure configuration.

QKnxNetIpSecureConfiguration:: ~QKnxNetIpSecureConfiguration ()

Releases any resources held by the secure configuration.

QByteArray QKnxNetIpSecureConfiguration:: deviceAuthenticationCode () const

Returns the device authentication code to establish the secure session as an array of bytes.

另请参阅 setDeviceAuthenticationCode ().

[static] QVector < QKnxNetIpSecureConfiguration > QKnxNetIpSecureConfiguration:: fromKeyring ( QKnxNetIpSecureConfiguration::Type type , const QString & keyring , const QByteArray & password , bool validate )

Constructs a vector of secure configurations for the given type type from an ETS exported keyring (*.knxkeys) file that was encrypted with the given password password 。设置 validate 自变量对于 true to verify that all data in the keyring file is trustworthy, false to omit the check.

注意: If an error occurred, no or invalid information for type was found in the keyring file, the returned vector can be empty.

[static] QKnxNetIpSecureConfiguration QKnxNetIpSecureConfiguration:: fromKeyring ( QKnxNetIpSecureConfiguration::Type type , const QKnxAddress & ia , const QString & keyring , const QByteArray & password , bool validate )

Constructs a secure configurations for the given type type and the given individual address ia from an ETS exported keyring (*.knxkeys) file that was encrypted with the given password password 。设置 validate 自变量对于 true to verify that all data in the keyring file is trustworthy, false to omit the check.

注意: If an error occurred, no or invalid information for type or ia was found in the keyring file; the function returns a 默认构造值 which can be invalid.

QKnxAddress QKnxNetIpSecureConfiguration:: host () const

Returns the host address of the secure KNX device this secure configuration targets. The host address can be empty and is not required to establish a secure session.

The purpose of this field is more to help GUI applications to indicate which KNX secure device can be used with this secure configuration.

另请参阅 setHost ().

QKnxAddress QKnxNetIpSecureConfiguration:: individualAddress () const

Returns the requested individual address for the secure session.

另请参阅 setIndividualAddress ().

bool QKnxNetIpSecureConfiguration:: isNull () const

返回 true if this is a default constructed secure configuration; otherwise returns false . A secure configuration is considered null if it contains no initialized values.

bool QKnxNetIpSecureConfiguration:: isSecureSessionKeepAliveSet () const

返回 true if the keep alive flag is set; false otherwise. By default this is set to false .

bool QKnxNetIpSecureConfiguration:: isValid () const

返回 true if the secure configuration contains initialized values and is in itself valid, otherwise returns false .

A valid secure configuration consists of at least a valid user ID, a valid secure key , and sensible device authentication code.

QKnxSecureKey QKnxNetIpSecureConfiguration:: privateKey () const

Returns the private secure key used to establish the secure session.

另请参阅 setPrivateKey ().

QKnxSecureKey QKnxNetIpSecureConfiguration:: publicKey () const

Returns the public secure key used to establish the secure session. The public key is derived from the given private key.

bool QKnxNetIpSecureConfiguration:: setDeviceAuthenticationCode (const QByteArray & authenticationCode )

Sets the device authentication code used to establish the secure session to authenticationCode 。返回 true 当成功时; false 否则。

注意: The device authentication code cannot be empty.

另请参阅 deviceAuthenticationCode ().

void QKnxNetIpSecureConfiguration:: setHost (const QKnxAddress & hostAddress )

Sets the secure configurations host address to hostAddress . The host address can be empty and is not required to establish a secure session.

另请参阅 host ().

bool QKnxNetIpSecureConfiguration:: setIndividualAddress (const QKnxAddress & address )

Sets the requested individual address of the secure session to address 。返回 true 当成功时; false 否则。

注意: To request any of the freely available addresses for the secure session, or to reset the requested one, pass an invalid address to the function.

另请参阅 individualAddress ().

void QKnxNetIpSecureConfiguration:: setKeepSecureSessionAlive ( bool keepAlive )

Determines whether the connection should be kept alive. Set keepAlive to true to keep a secure session alive even if there is no traffic for more than 60 seconds .

bool QKnxNetIpSecureConfiguration:: setPrivateKey (const QKnxSecureKey & key )

设置 secure key used to establish the secure connection to key 并返回 true 当成功时; false 否则。

另请参阅 privateKey ().

bool QKnxNetIpSecureConfiguration:: setUserId ( QKnxNetIp::SecureUserId userId )

Sets the user ID used in the KNXnet/IP session authentication frame to userId 并返回 true 当成功时; false 否则。

注意: A userId () with the value QKnxNetIp::SecureUserId::Reserved or equal to or more than QKnxNetIp::SecureUserId::Invalid is considered invalid according to the KNX application note AN159.

另请参阅 userId ().

void QKnxNetIpSecureConfiguration:: setUserPassword (const QByteArray & userPassword )

Sets the user password to authenticate the user while establishing the secure session to userPassword 。返回 true 当成功时; false 否则。

另请参阅 userPassword ().

void QKnxNetIpSecureConfiguration:: swap ( QKnxNetIpSecureConfiguration & other )

交换 other with this secure configuration. This operation is very fast and never fails.

QKnxNetIp::SecureUserId QKnxNetIpSecureConfiguration:: userId () const

Returns the user ID used in the KNXnet/IP session authentication frame.

另请参阅 setUserId ().

QByteArray QKnxNetIpSecureConfiguration:: userPassword () const

Returns the user password used to authenticate the user while establishing the secure session as an array of bytes.

另请参阅 setUserPassword ().

bool QKnxNetIpSecureConfiguration:: operator!= (const QKnxNetIpSecureConfiguration & other ) const

返回 true if this secure configuration and the given other 不相等;则返回 false .

bool QKnxNetIpSecureConfiguration:: operator== (const QKnxNetIpSecureConfiguration & other ) const

返回 true if this secure configuration and the given other 相等;否则返回 false .