![]() |
Qt 6.x
The Qt SDK
|
#include <qasn1element_p.h>
Public Types | |
enum | ElementType { BooleanType = 0x01 , IntegerType = 0x02 , BitStringType = 0x03 , OctetStringType = 0x04 , NullType = 0x05 , ObjectIdentifierType = 0x06 , Utf8StringType = 0x0c , PrintableStringType = 0x13 , TeletexStringType = 0x14 , UtcTimeType = 0x17 , GeneralizedTimeType = 0x18 , SequenceType = 0x30 , SetType = 0x31 , Rfc822NameType = 0x81 , DnsNameType = 0x82 , UniformResourceIdentifierType = 0x86 , IpAddressType = 0x87 , Context0Type = 0xA0 , Context1Type = 0xA1 , Context3Type = 0xA3 } |
Public Member Functions | |
QAsn1Element (quint8 type=0, const QByteArray &value=QByteArray()) | |
bool | read (QDataStream &data) |
bool | read (const QByteArray &data) |
void | write (QDataStream &data) const |
bool | toBool (bool *ok=nullptr) const |
QDateTime | toDateTime () const |
QMultiMap< QByteArray, QString > | toInfo () const |
qint64 | toInteger (bool *ok=nullptr) const |
QList< QAsn1Element > | toList () const |
QByteArray | toObjectId () const |
QByteArray | toObjectName () const |
QString | toString () const |
quint8 | type () const |
QByteArray | value () const |
Static Public Member Functions | |
static QAsn1Element | fromBool (bool val) |
static QAsn1Element | fromInteger (unsigned int val) |
static QAsn1Element | fromVector (const QList< QAsn1Element > &items) |
static QAsn1Element | fromObjectId (const QByteArray &id) |
Friends | |
bool | operator== (const QAsn1Element &, const QAsn1Element &) |
bool | operator!= (const QAsn1Element &, const QAsn1Element &) |
Definition at line 82 of file qasn1element_p.h.
Definition at line 85 of file qasn1element_p.h.
|
explicit |
|
static |
Definition at line 143 of file qasn1element.cpp.
References BooleanType.
Referenced by toBool().
|
static |
Definition at line 149 of file qasn1element.cpp.
References IntegerType, and QByteArray::prepend().
Referenced by _q_makePkcs12(), _q_PKCS12_key(), _q_PKCS12_mac(), and _q_PKCS12_shroudedKeyBag().
|
static |
Definition at line 170 of file qasn1element.cpp.
References i, ObjectIdentifierType, and Q_ASSERT.
Referenced by _q_PKCS12_certBag(), _q_PKCS12_key(), _q_PKCS12_mac(), _q_PKCS12_shroudedKeyBag(), and _q_PKCS7_data().
|
static |
Definition at line 160 of file qasn1element.cpp.
References QList< T >::cbegin(), QList< T >::cend(), it, items, SequenceType, and QIODeviceBase::WriteOnly.
Referenced by _q_makePkcs12(), _q_PKCS12_bag(), _q_PKCS12_certBag(), _q_PKCS12_key(), _q_PKCS12_mac(), _q_PKCS12_shroudedKeyBag(), and _q_PKCS7_data().
bool QAsn1Element::read | ( | const QByteArray & | data | ) |
Definition at line 110 of file qasn1element.cpp.
References read().
bool QAsn1Element::read | ( | QDataStream & | data | ) |
Definition at line 60 of file qasn1element.cpp.
References QByteArray::append(), i, qMin(), and QByteArray::swap().
Referenced by QTlsPrivate::TlsKeyGeneric::decodeDer(), QTlsPrivate::TlsKeyBase::isEncryptedPkcs8(), QTlsPrivate::X509CertificateGeneric::parse(), QTlsPrivate::X509CertificateGeneric::parseExtension(), read(), toInfo(), and toList().
bool QAsn1Element::toBool | ( | bool * | ok = nullptr | ) | const |
Definition at line 193 of file qasn1element.cpp.
References fromBool(), and ok.
Referenced by QTlsPrivate::X509CertificateGeneric::parseExtension().
QDateTime QAsn1Element::toDateTime | ( | ) | const |
Definition at line 210 of file qasn1element.cpp.
References QDate::addYears(), QByteArray::back(), date, QString::fromLatin1(), GeneralizedTimeType, QtMiscUtils::isAsciiDigit(), Q_ASSERT, QStringLiteral, QDate::setDate(), QByteArray::size(), Qt::UTC, UtcTimeType, and QDate::year().
Referenced by QTlsPrivate::X509CertificateGeneric::parse().
QMultiMap< QByteArray, QString > QAsn1Element::toInfo | ( | ) | const |
Definition at line 257 of file qasn1element.cpp.
References QByteArray::front(), info, read(), SequenceType, SetType, and toList().
Referenced by QTlsPrivate::X509CertificateGeneric::parse().
Definition at line 277 of file qasn1element.cpp.
References QByteArray::at(), i, IntegerType, QByteArray::isEmpty(), ok, QByteArray::size(), and value().
QList< QAsn1Element > QAsn1Element::toList | ( | ) | const |
Definition at line 302 of file qasn1element.cpp.
References items, read(), and SequenceType.
Referenced by QTlsPrivate::TlsKeyGeneric::decodeDer(), QTlsPrivate::TlsKeyBase::isEncryptedPkcs8(), and toInfo().
QByteArray QAsn1Element::toObjectId | ( | ) | const |
Definition at line 314 of file qasn1element.cpp.
References QByteArray::at(), i, QByteArray::isEmpty(), QByteArray::number(), ObjectIdentifierType, and QByteArray::size().
Referenced by QTlsPrivate::TlsKeyGeneric::decodeDer(), QTlsPrivate::X509CertificateGeneric::parse(), QTlsPrivate::X509CertificateGeneric::parseExtension(), and toObjectName().
QByteArray QAsn1Element::toObjectName | ( | ) | const |
Definition at line 333 of file qasn1element.cpp.
References toObjectId().
Referenced by QTlsPrivate::X509CertificateGeneric::parseExtension().
QString QAsn1Element::toString | ( | ) | const |
Definition at line 339 of file qasn1element.cpp.
References DnsNameType, QString::fromLatin1(), QString::fromUtf8(), PrintableStringType, qstrlen(), Rfc822NameType, QByteArray::size(), TeletexStringType, UniformResourceIdentifierType, and Utf8StringType.
Referenced by QTlsPrivate::X509CertificateGeneric::parse().
|
inline |
Definition at line 132 of file qasn1element_p.h.
Referenced by QTlsPrivate::TlsKeyGeneric::decodeDer(), QTlsPrivate::TlsKeyBase::isEncryptedPkcs8(), QTlsPrivate::X509CertificateGeneric::parse(), and QTlsPrivate::X509CertificateGeneric::parseExtension().
|
inline |
Definition at line 133 of file qasn1element_p.h.
Referenced by QTlsPrivate::TlsKeyGeneric::decodeDer(), QTlsPrivate::X509CertificateGeneric::parse(), QTlsPrivate::X509CertificateGeneric::parseExtension(), and toInteger().
void QAsn1Element::write | ( | QDataStream & | data | ) | const |
Definition at line 116 of file qasn1element.cpp.
References ba, QByteArray::data(), QByteArray::prepend(), and QByteArray::size().
Referenced by _q_makePkcs12(), _q_PKCS12_bag(), _q_PKCS12_certBag(), and _q_PKCS12_shroudedKeyBag().
|
friend |
Definition at line 147 of file qasn1element_p.h.
|
friend |
Definition at line 144 of file qasn1element_p.h.