QKnxNetIpSessionAuthenticateProxy Class

The QKnxNetIpSessionAuthenticateProxy class provides the means to introspect session authentication data inside the generic QKnxNetIpFrame class and to create a KNXnet/IP session authentication frame from provided data. 更多...

头: #include <QKnxNetIpSessionAuthenticateProxy>
qmake: QT += knx
Since: Qt 5.12

该类在 Qt 5.12 引入。

公共类型

class Builder
class SecureBuilder

公共函数

QKnxNetIpSessionAuthenticateProxy (const QKnxNetIpFrame & frame )
bool isValid () const
QKnxByteArray messageAuthenticationCode () const
QKnxNetIp::SecureUserId userId () const

静态公共成员

QKnxNetIpSessionAuthenticateProxy::Builder builder ()
QKnxNetIpSessionAuthenticateProxy::SecureBuilder secureBuilder ()

详细描述

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 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.

注意: When using QKnxNetIpSessionAuthenticateProxy, care must be taken to ensure that the referenced KNXnet/IP frame outlives the proxy on all code paths, lest the proxy ends up referencing deleted data.

The following code sample illustrates how to read the session authentication information:

auto netIpFrame = QKnxNetIpFrame::fromBytes(...);
const QKnxNetIpSessionAuthenticateProxy proxy(netIpFrame);
if (!proxy.isValid())
    return;
auto id = proxy.userId();
auto authenticatenCode = proxy.messageAuthenticationCode();
					

另请参阅 builder () 和 Qt KNXnet/IP Connection Classes .

成员函数文档编制

QKnxNetIpSessionAuthenticateProxy:: QKnxNetIpSessionAuthenticateProxy (const QKnxNetIpFrame & frame )

Constructs a proxy object to read the session authentication information carried by the specified KNXnet/IP frame frame .

[static] QKnxNetIpSessionAuthenticateProxy::Builder QKnxNetIpSessionAuthenticateProxy:: builder ()

Returns a builder object to create a KNXnet/IP session authentication frame.

bool QKnxNetIpSessionAuthenticateProxy:: isValid () const

返回 true if the frame contains initialized values and is in itself valid, otherwise returns false . A valid KNXnet/IP frame consists of at least a valid header and a size in bytes corresponding to the total size of the KNXnet/IP frame header.

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

注意: KNXnet/IP session authentication frames currently have a fixed size of 24 字节。

另请参阅 QKnxNetIpFrameHeader::totalSize ().

QKnxByteArray QKnxNetIpSessionAuthenticateProxy:: messageAuthenticationCode () const

Returns the AES128 CCM message authentication code (MAC) from the generic KNXnet/IP session authentication frame with a fixed size of 16 字节。

[static] QKnxNetIpSessionAuthenticateProxy::SecureBuilder QKnxNetIpSessionAuthenticateProxy:: secureBuilder ()

Returns a builder object to create a KNXnet/IP session authentication frame.

QKnxNetIp::SecureUserId QKnxNetIpSessionAuthenticateProxy:: userId () const

Returns the user ID from the generic KNXnet/IP session authentication frame.