QCoapSecurityConfiguration Class

The QCoapSecurityConfiguration class holds configuration options during the authentication process. 更多...

头: #include <QCoapSecurityConfiguration>
CMake: find_package(Qt6 REQUIRED COMPONENTS Coap)
target_link_libraries(mytarget PRIVATE Qt6::Coap)
qmake: QT += coap

公共函数

QCoapSecurityConfiguration ()
QCoapSecurityConfiguration (const QCoapSecurityConfiguration & other )
QCoapSecurityConfiguration (QCoapSecurityConfiguration && other )
~QCoapSecurityConfiguration ()
QList<QSslCertificate> caCertificates () const
QString defaultCipherString () const
QList<QSslCertificate> localCertificateChain () const
QByteArray preSharedKey () const
QByteArray preSharedKeyIdentity () const
QCoapPrivateKey privateKey () const
void setCaCertificates (const QList<QSslCertificate> & certificates )
void setDefaultCipherString (const QString & cipherString )
void setLocalCertificateChain (const QList<QSslCertificate> & localChain )
void setPreSharedKey (const QByteArray & preSharedKey )
void setPreSharedKeyIdentity (const QByteArray & identity )
void setPrivateKey (const QCoapPrivateKey & key )
void swap (QCoapSecurityConfiguration & other )
QCoapSecurityConfiguration & operator= (const QCoapSecurityConfiguration & other )

详细描述

It holds information such as client identity, pre shared key, information about certificates, and so on.

成员函数文档编制

QCoapSecurityConfiguration:: QCoapSecurityConfiguration ()

Constructs a new QCoapSecurityConfiguration.

QCoapSecurityConfiguration:: QCoapSecurityConfiguration (const QCoapSecurityConfiguration & other )

Copies the configuration and state of other .

[noexcept] QCoapSecurityConfiguration:: QCoapSecurityConfiguration ( QCoapSecurityConfiguration && other )

Move-constructs a QCoapSecurityConfiguration, making it point to the same object as other 所指向的。

[noexcept] QCoapSecurityConfiguration:: ~QCoapSecurityConfiguration ()

Releases any resources held by QCoapSecurityConfiguration .

QList < QSslCertificate > QCoapSecurityConfiguration:: caCertificates () const

Returns this connection's certificate authority certificate database.

另请参阅 setCaCertificates ().

QString QCoapSecurityConfiguration:: defaultCipherString () const

Returns the default cipher string.

另请参阅 setDefaultCipherString ().

QList < QSslCertificate > QCoapSecurityConfiguration:: localCertificateChain () const

Returns the certificate chain to be presented to the peer during the handshake.

另请参阅 setLocalCertificateChain ().

QByteArray QCoapSecurityConfiguration:: preSharedKey () const

Returns the pre shared key.

另请参阅 setPreSharedKey ().

QByteArray QCoapSecurityConfiguration:: preSharedKeyIdentity () const

Returns the PSK client identity.

另请参阅 setPreSharedKeyIdentity ().

QCoapPrivateKey QCoapSecurityConfiguration:: privateKey () const

Returns the private key assigned to the connection.

另请参阅 setPrivateKey () 和 localCertificateChain ().

void QCoapSecurityConfiguration:: setCaCertificates (const QList < QSslCertificate > & certificates )

设置 certificates as the certificate authority database for the connection.

另请参阅 caCertificates ().

void QCoapSecurityConfiguration:: setDefaultCipherString (const QString & cipherString )

Sets the SSL cipher string to cipherString .

The security back-end (for example OpenSSL) might not include ciphers required for RFC 7252 by default. This method specifies which ciphers the back-end should use. For example to enable CCM ciphers required by RFC, "AESCCM" can be passed as cipherString .

OpenSSL docs for more information about cipher strings.

另请参阅 defaultCipherString ().

void QCoapSecurityConfiguration:: setLocalCertificateChain (const QList < QSslCertificate > & localChain )

设置 localChain as the certificate chain to present to the peer during the handshake.

另请参阅 localCertificateChain ().

void QCoapSecurityConfiguration:: setPreSharedKey (const QByteArray & preSharedKey )

Sets the pre shared key to preSharedKey .

另请参阅 preSharedKey ().

void QCoapSecurityConfiguration:: setPreSharedKeyIdentity (const QByteArray & identity )

Sets the PSK client identity (to be advised to the server) to identity .

另请参阅 preSharedKeyIdentity ().

void QCoapSecurityConfiguration:: setPrivateKey (const QCoapPrivateKey & key )

Sets the connection's private key to key .

另请参阅 privateKey () 和 setLocalCertificateChain ().

[noexcept] void QCoapSecurityConfiguration:: swap ( QCoapSecurityConfiguration & other )

Swaps this security configuration with other 。此操作非常快且从不失败。

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

Copies the configuration and state of other .