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.
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. |
Move-constructs a secure configuration, making it point to the same secure configuration that other 所指向的。
构造副本为 other .
Constructs a new, empty, invalid secure configuration.
移动赋值 other to this secure configuration.
赋值指定 other to this secure configuration.
Releases any resources held by the secure configuration.
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.
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 ().
Returns the requested individual address for the secure session.
另请参阅 setIndividualAddress ().
返回
true
if this is a default constructed secure configuration; otherwise returns
false
. A secure configuration is considered
null
if it contains no initialized values.
返回
true
if the keep alive flag is set;
false
otherwise. By default this is set to
false
.
返回
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.
Returns the private secure key used to establish the secure session.
另请参阅 setPrivateKey ().
Returns the public secure key used to establish the secure session. The public key is derived from the given private key.
Sets the device authentication code used to establish the secure session to
authenticationCode
。返回
true
当成功时;
false
否则。
注意: The device authentication code cannot be empty.
另请参阅 deviceAuthenticationCode ().
Sets the secure configurations host address to hostAddress . The host address can be empty and is not required to establish a secure session.
另请参阅 host ().
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 ().
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
.
设置
secure key
used to establish the secure connection to
key
并返回
true
当成功时;
false
否则。
另请参阅 privateKey ().
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 ().
Sets the user password to authenticate the user while establishing the secure session to
userPassword
。返回
true
当成功时;
false
否则。
另请参阅 userPassword ().
交换 other with this secure configuration. This operation is very fast and never fails.
Returns the user ID used in the KNXnet/IP session authentication frame.
另请参阅 setUserId ().
Returns the user password used to authenticate the user while establishing the secure session as an array of bytes.
另请参阅 setUserPassword ().
返回
true
if this secure configuration and the given
other
不相等;则返回
false
.
返回
true
if this secure configuration and the given
other
相等;否则返回
false
.