SecureBuilder Class

class QKnxNetIpSessionResponseProxy ::SecureBuilder

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

公共函數

SecureBuilder (const SecureBuilder & other )
SecureBuilder ()
SecureBuilder & operator= (const SecureBuilder & other )
~SecureBuilder ()
QKnxNetIpFrame create (const QByteArray & devicePassword , const QKnxByteArray & clientPublicKey ) const
SecureBuilder & setPublicKey (const QKnxByteArray & serverPublicKey )
SecureBuilder & setSecureSessionId (quint16 sessionId )

詳細描述

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 server to the KNXnet/IP secure client control endpoint in response to a received secure session request frame.

The common way to create a session response frame is:

auto serverPublicKey = ... // create the public key
auto auth = ... // create the full 128 bit CCM-MAC
auto netIpFrame = QKnxNetIpSessionResponseProxy::secureBuilder()
    .setSecureSessionId(0x1976)
    .setPublicKey(serverPublicKey)
    .create();
					

另請參閱 QKnxCryptographicEngine .

成員函數文檔編製

SecureBuilder:: SecureBuilder (const SecureBuilder & other )

構造副本為 other .

SecureBuilder:: SecureBuilder ()

Creates a new empty session response builder object.

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

賦值指定 other 到此對象。

SecureBuilder:: ~SecureBuilder ()

銷毀對象並釋放任何分配資源。

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

Creates and returns a KNXnet/IP session response frame.

The function computes the AES128 CCM message authentication code (MAC) with the given device password devicePassword and the Curve25519 client public key clientPublicKey and appends it to the newly created frame.

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

另請參閱 isValid ().

SecureBuilder &SecureBuilder:: setPublicKey (const QKnxByteArray & serverPublicKey )

Sets the public key of the KNXnet/IP session response frame to serverPublicKey and returns a reference to the builder. The public key needs to be generated using the Curve25519 algorithm and has a fixed size of 32 字節。

SecureBuilder &SecureBuilder:: setSecureSessionId ( quint16 sessionId )

Sets the secure session ID of the KNXnet/IP session response frame to sessionId and returns a reference to the builder.