The QSslCertificateExtension class provides an API for accessing the extensions of an X509 certificate. More...
|CMake:|| find_package(Qt6 REQUIRED COMPONENTS Network) |
target_link_libraries(mytarget PRIVATE Qt6::Network)
|qmake:||QT += network|
- List of all members, including inherited members
- QSslCertificateExtension is part of Network Programming API and Implicitly Shared Classes.
Note: All functions in this class are reentrant.
|QSslCertificateExtension(const QSslCertificateExtension &other)|
|QSslCertificateExtension &||operator=(const QSslCertificateExtension &other)|
QSslCertificateExtension provides access to an extension stored in an X509 certificate. The information available depends on the type of extension being accessed.
All X509 certificate extensions have the following properties:
|name||The human readable name of the extension, eg. 'basicConstraints'.|
|criticality||This is a boolean value indicating if the extension is critical to correctly interpreting the certificate.|
|oid||The ASN.1 object identifier that specifies which extension this is.|
|supported||If this is true the structure of the extension's value will not change between Qt versions.|
|value||A QVariant with a structure dependent on the type of extension.|
Whilst this class provides access to any type of extension, only some are guaranteed to be returned in a format that will remain unchanged between releases. The isSupported() method returns
true for extensions where this is the case.
The extensions currently supported, and the structure of the value returned are as follows:
|basicConstraints||126.96.36.199||Returned as a QVariantMap. The key 'ca' contains a boolean value, the optional key 'pathLenConstraint' contains an integer.|
|authorityInfoAccess||188.8.131.52.184.108.40.206.1||Returned as a QVariantMap. There is a key for each access method, with the value being a URI.|
|subjectKeyIdentifier||220.127.116.11||Returned as a QVariant containing a QString. The string is the key identifier.|
|authorityKeyIdentifier||18.104.22.168||Returned as a QVariantMap. The optional key 'keyid' contains the key identifier as a hex string stored in a QByteArray. The optional key 'serial' contains the authority key serial number as a qlonglong. Currently there is no support for the general names field of this extension.|
In addition to the supported extensions above, many other common extensions will be returned in a reasonably structured way. Extensions that the SSL backend has no support for at all will be returned as a QByteArray.
Further information about the types of extensions certificates can contain can be found in RFC 5280.
See also QSslCertificate::extensions().
Member Function Documentation
Constructs a QSslCertificateExtension.
QSslCertificateExtension::QSslCertificateExtension(const QSslCertificateExtension &other)
Constructs a copy of other.
Destroys the extension.
Returns the criticality of the extension.
Returns the true if this extension is supported. In this case, supported simply means that the structure of the QVariant returned by the value() accessor will remain unchanged between versions. Unsupported extensions can be freely used, however there is no guarantee that the returned data will have the same structure between versions.
QString QSslCertificateExtension::name() const
Returns the name of the extension. If no name is known for the extension then the OID will be returned.
QString QSslCertificateExtension::oid() const
Returns the ASN.1 OID of this extension.
void QSslCertificateExtension::swap(QSslCertificateExtension &other)
Swaps this certificate extension instance with other. This function is very fast and never fails.
QVariant QSslCertificateExtension::value() const
Returns the value of the extension. The structure of the value returned depends on the extension type.
QSslCertificateExtension &QSslCertificateExtension::operator=(const QSslCertificateExtension &other)
Assigns other to this extension and returns a reference to this extension.
© 2023 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.