The QKnxNetIpSecureWrapperProxy class provides the means to introspect secure wrapper data inside the generic QKnxNetIpFrame class and to create a KNXnet/IP secure wrapper frame from provided data. 更多...
头: | #include <QKnxNetIpSecureWrapperProxy> |
qmake: | QT += knx |
Since: | Qt 5.12 |
该类在 Qt 5.12 引入。
class | Builder |
class | SecureBuilder |
QKnxNetIpSecureWrapperProxy (const QKnxNetIpFrame & frame ) | |
QKnxByteArray | encapsulatedFrame () const |
bool | isValid () const |
QKnxByteArray | messageAuthenticationCode () const |
quint16 | messageTag () const |
quint16 | secureSessionId () const |
quint48 | sequenceNumber () const |
QKnxByteArray | serialNumber () const |
QKnxNetIpSecureWrapperProxy::Builder | builder () |
QKnxNetIpSecureWrapperProxy::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 during secure KNXnet/IP communication and includes a fully encrypted KNXnet/IP frame as well as information needed to decrypt the encapsulated frame and to ensure data integrity and freshness.
注意: When using QKnxNetIpSecureWrapperProxy, 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 secure wrapper information:
auto netIpFrame = QKnxNetIpFrame::fromBytes(...); const QKnxNetIpSecureWrapperProxy proxy(netIpFrame); if (!proxy.isValid()) return; quint16 id = proxy.secureSessionId(); quint48 seqNumber = proxy.sequenceNumber(); QKnxByteArray number = proxy.serialNumber(); quint16 tag = proxy.tag(); QKnxByteArray frame = proxy.encapsulatedFrame(); QKnxByteArray code = proxy.messageAuthenticationCode();
另请参阅 builder () 和 Qt KNXnet/IP Connection Classes .
Constructs a proxy object to read the secure wrapper information carried by the specified KNXnet/IP frame frame .
[static]
QKnxNetIpSecureWrapperProxy::Builder
QKnxNetIpSecureWrapperProxy::
builder
()
Returns a builder object to create a KNXnet/IP secure wrapper frame.
Returns the encrypted encapsulated frame from the generic KNXnet/IP secure wrapper frame.
返回
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.
注意:
KNXnet/IP secure wrapper frames currently have a minimum size of
44
字节。
另请参阅 QKnxNetIpFrameHeader::totalSize ().
Returns the AES128 CCM message authentication code (MAC) from the generic KNXnet/IP secure wrapper frame with a fixed size of
16
字节。
Returns the message tag from the generic KNXnet/IP secure wrapper frame.
[static]
QKnxNetIpSecureWrapperProxy::SecureBuilder
QKnxNetIpSecureWrapperProxy::
secureBuilder
()
Returns a builder object to create a KNXnet/IP secure wrapper frame.
Returns the secure session ID from the generic KNXnet/IP secure wrapper frame.
Returns the sequence number from the generic KNXnet/IP secure wrapper frame.
Returns the serial number from the generic KNXnet/IP secure wrapper frame.