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 引入。
| 枚舉類 | 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
.