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) {
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)
172 if (!elem.
read(certStream))
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))
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());
@ UniformResourceIdentifierType
QByteArray toObjectName() const
QMultiMap< QByteArray, QString > toInfo() const
QDateTime toDateTime() const
bool read(QDataStream &data)
QByteArray toObjectId() const
bool toBool(bool *ok=nullptr) const
char * data()
\macro QT_NO_CAST_FROM_BYTEARRAY
qsizetype size() const noexcept
Returns the number of bytes in this byte array.
qsizetype indexOf(char c, qsizetype from=0) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QByteArray fromBase64(const QByteArray &base64, Base64Options options=Base64Encoding)
char at(qsizetype i) const
Returns the byte at index position i in the byte array.
bool isEmpty() const noexcept
Returns true if the byte array has size 0; otherwise returns false.
static QByteArray number(int, int base=10)
Returns a byte-array representing the whole number n as text.
QByteArray left(qsizetype len) const
Returns a byte array that contains the first len bytes of this byte array.
void resize(qsizetype size)
Sets the size of the byte array to size bytes.
QByteArray mid(qsizetype index, qsizetype len=-1) const
Returns a byte array containing len bytes from this byte array, starting at position pos.
static QByteArray fromRawData(const char *data, qsizetype size)
Constructs a QByteArray that uses the first size bytes of the data array.
\inmodule QtCore\reentrant
int readRawData(char *, int len)
Reads at most len bytes from the stream into s and returns the number of bytes read.
QIODevice * device() const
Returns the I/O device currently set, or \nullptr if no device is currently set.
bool isValid() const
Returns true if this datetime represents a definite moment, otherwise false.
The QHostAddress class provides an IP address.
bool isNull() const
Returns true if this host address is not valid for any host or interface.
QString toString() const
Returns the address as a string.
virtual qint64 pos() const
For random-access devices, this function returns the position that data is written to or read from.
virtual bool seek(qint64 pos)
For random-access devices, this function sets the current position to pos, returning true on success,...
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]