SecureBuilder Class

class QKnxNetIpSessionAuthenticateProxy ::SecureBuilder

The QKnxNetIpSessionAuthenticateProxy::SecureBuilder class provides the means to create a KNXnet/IP session authentication frame. 更多...

公共函数

SecureBuilder (const SecureBuilder & other )
SecureBuilder ()
SecureBuilder & operator= (const SecureBuilder & other )
~SecureBuilder ()
QKnxNetIpFrame create (const QByteArray & sessionPassword , const QKnxByteArray & clientPublicKey , const QKnxByteArray & serverPublicKey ) const
SecureBuilder & setUserId (QKnxNetIp::SecureUserId userId )

详细描述

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.

注意: To use this class OpenSSL must be supported on your target system.

This frame will be sent by the KNXnet/IP secure client to the control endpoint of the KNXnet/IP secure server after the Diffie-Hellman handshake to authenticate the user against the server device. The maximum time a KNXnet/IP secure client will wait for an authentication status response of the KNXnet/IP secure server is 10 seconds.

The common way to create a session authentication frame is:

auto netIpFrame = QKnxNetIpSessionAuthenticateProxy::secureBuilder()
    .setUserId(QKnxNetIp::SecureUserId::Management)
    .create(passwordHash, clientKey, serverKey);
					

另请参阅 QKnxCryptographicEngine .

成员函数文档编制

SecureBuilder:: SecureBuilder (const SecureBuilder & other )

构造副本为 other .

SecureBuilder:: SecureBuilder ()

Creates a new empty session authentication frame builder.

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

赋值指定 other 到此对象。

SecureBuilder:: ~SecureBuilder ()

销毁对象并释放任何分配资源。

QKnxNetIpFrame SecureBuilder:: create (const QByteArray & sessionPassword , const QKnxByteArray & clientPublicKey , const QKnxByteArray & serverPublicKey ) const

Creates and returns a KNXnet/IP session authentication frame.

The function computes the AES128 CCM message authentication code (MAC) with the given user session password sessionPassword , the Curve25519 client public key clientPublicKey , the Curve25519 server public key serverPublicKey and appends it to the newly created frame.

注意: The returned frame may be invalid depending on the values used during setup.

另请参阅 isValid ().

SecureBuilder &SecureBuilder:: setUserId ( QKnxNetIp::SecureUserId userId )

Sets the user ID of the KNXnet/IP session authentication frame to userId and returns a reference to the builder.

注意: 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.