4#include <QtNetwork/private/qsslcertificate_p.h>
5#include <QtNetwork/private/qssl_p.h>
10#include <QtNetwork/qhostaddress.h>
12#include <QtCore/qendian.h>
13#include <QtCore/qhash.h>
32 return value.mid(
i).toHex(
':');
56#define BEGINCERTSTRING "-----BEGIN CERTIFICATE-----"
57#define ENDCERTSTRING "-----END CERTIFICATE-----"
65 for (
int i = 0;
i <=
array.size() - 64;
i += 64) {
69 if (
int remainder =
array.size() % 64) {
101 QList<QSslCertificate> certificates;
103 while (
count == -1 || certificates.size() <
count) {
129 QList<QSslCertificate> certificates;
132 while (
count == -1 || certificates.size() <
count) {
134 auto *certBackend = QTlsBackend::backend<X509CertificateGeneric>(
cert);
135 if (!certBackend->parse(
data))
138 certificates <<
cert;
161 if (!elem.read(certStream))
166 if (!elem.read(versionStream)
168 || elem.value().isEmpty())
172 if (!elem.read(certStream))
191 QByteArray issuerDer =
data.
mid(dataStream.device()->pos() - elem.value().size(), elem.value().size());
218 QByteArray subjectDer =
data.
mid(dataStream.device()->pos() - elem.value().size(), elem.value().size());
223 qint64 keyStart = certStream.device()->pos();
247 certStream.device()->seek(keyStart);
251 while (elem.read(certStream)) {
275 while (nameElem.read(nameStream)) {
276 switch (nameElem.type()) {
288 switch (ipAddrValue.size()) {
298 if (!ipAddress.isNull()) {
327 bool critical =
false;
338 if (!valElem.read(seqStream))
342 critical = valElem.toBool(&
ok);
344 if (!
ok || !valElem.read(seqStream))
353 bool supported =
true;
355 if (oid ==
"1.3.6.1.5.5.7.1.1") {
360 const auto elems = val.toList();
362 const auto items =
el.toList();
375 }
else if (oid ==
"2.5.29.14") {
379 value = colonSeparatedHex(val.value()).toUpper();
380 }
else if (oid ==
"2.5.29.19") {
400 }
else if (oid ==
"2.5.29.35") {
405 const auto elems = val.toList();
407 if (
el.type() == 0x80) {
410 }
else if (
el.type() == 0x82) {
412 result[serial] = colonSeparatedHex(
el.value());
418 value = valElem.value();
@ UniformResourceIdentifierType
bool read(QDataStream &data)
char * data()
\macro QT_NO_CAST_FROM_BYTEARRAY
qsizetype size() const noexcept
Returns the number of bytes in this byte array.
QByteArray left(qsizetype n) const &
static QByteArray fromBase64(const QByteArray &base64, Base64Options options=Base64Encoding)
static QByteArray number(int, int base=10)
Returns a byte-array representing the whole number n as text.
void resize(qsizetype size)
Sets the size of the byte array to size bytes.
QByteArray mid(qsizetype index, qsizetype len=-1) const &
static QByteArray fromRawData(const char *data, qsizetype size)
Constructs a QByteArray that uses the first size bytes of the data array.
\inmodule QtCore\reentrant
bool isValid() const
Returns true if this datetime represents a definite moment, otherwise false.
The QHostAddress class provides an IP address.
qsizetype size() const noexcept
QList< T > toList() const noexcept
const_reference at(qsizetype i) const noexcept
T value(qsizetype i) const
void remove(qsizetype i, qsizetype n=1)
iterator insert(const Key &key, const T &value)
The QSslCertificate class provides a convenient API for an X509 certificate.
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QList< X509CertificateExtension > extensions
QMultiMap< QByteArray, QString > subjectInfoEntries
QMultiMap< QByteArray, QString > issuerInfoEntries
QByteArray serialNumberString
static bool matchLineFeed(const QByteArray &pem, int *offset)
QMultiMap< QSsl::AlternativeNameEntryType, QString > subjectAlternativeNames() const override
QByteArray toDer() const override
bool isSelfSigned() const override
static QList< QSslCertificate > certificatesFromDer(const QByteArray &der, int count)
bool subjectMatchesIssuer
QMultiMap< QSsl::AlternativeNameEntryType, QString > saNames
size_t hash(size_t seed) const noexcept override
bool parseExtension(const QByteArray &data, X509CertificateExtension &extension)
bool isEqual(const X509Certificate &rhs) const override
QString toText() const override
Qt::HANDLE handle() const override
bool parse(const QByteArray &data)
QByteArray toPem() const override
static QList< QSslCertificate > certificatesFromPem(const QByteArray &pem, int count)
QByteArray publicKeyDerData
QSsl::KeyAlgorithm publicKeyAlgorithm
X509Certificate is an abstract class that allows a TLS backend to provide an implementation of the QS...
Combined button and popup list for selecting options.
Namespace containing onternal types that TLS backends implement.
#define EC_ENCRYPTION_OID
#define DSA_ENCRYPTION_OID
#define RSA_ENCRYPTION_OID
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
constexpr T qFromBigEndian(T source)
size_t qHash(const QFileSystemWatcherPathKey &key, size_t seed=0)
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLintptr offset
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
#define QStringLiteral(str)
#define Q_UNIMPLEMENTED()
QList< QSslCertificate > cert
[0]