Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QAsn1Element Class Reference

#include <qasn1element_p.h>

+ Collaboration diagram for QAsn1Element:

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, QStringtoInfo () const
 
qint64 toInteger (bool *ok=nullptr) const
 
QList< QAsn1ElementtoList () 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 &)
 

Detailed Description

Definition at line 82 of file qasn1element_p.h.

Member Enumeration Documentation

◆ ElementType

Enumerator
BooleanType 
IntegerType 
BitStringType 
OctetStringType 
NullType 
ObjectIdentifierType 
Utf8StringType 
PrintableStringType 
TeletexStringType 
UtcTimeType 
GeneralizedTimeType 
SequenceType 
SetType 
Rfc822NameType 
DnsNameType 
UniformResourceIdentifierType 
IpAddressType 
Context0Type 
Context1Type 
Context3Type 

Definition at line 85 of file qasn1element_p.h.

Constructor & Destructor Documentation

◆ QAsn1Element()

QAsn1Element::QAsn1Element ( quint8 type = 0,
const QByteArray & value = QByteArray() )
explicit

Referenced by fromBool().

+ Here is the caller graph for this function:

Member Function Documentation

◆ fromBool()

QAsn1Element QAsn1Element::fromBool ( bool val)
static

Definition at line 144 of file qasn1element.cpp.

References QAsn1Element(), BooleanType, and QByteArray().

Referenced by toBool().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fromInteger()

QAsn1Element QAsn1Element::fromInteger ( unsigned int val)
static

Definition at line 150 of file qasn1element.cpp.

References IntegerType.

Referenced by _q_makePkcs12(), _q_PKCS12_key(), _q_PKCS12_mac(), and _q_PKCS12_shroudedKeyBag().

+ Here is the caller graph for this function:

◆ fromObjectId()

QAsn1Element QAsn1Element::fromObjectId ( const QByteArray & id)
static

Definition at line 171 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().

+ Here is the caller graph for this function:

◆ fromVector()

QAsn1Element QAsn1Element::fromVector ( const QList< QAsn1Element > & items)
static

Definition at line 161 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read() [1/2]

bool QAsn1Element::read ( const QByteArray & data)

Definition at line 111 of file qasn1element.cpp.

References read().

+ Here is the call graph for this function:

◆ read() [2/2]

bool QAsn1Element::read ( QDataStream & data)

Definition at line 61 of file qasn1element.cpp.

References i, qMin(), and QByteArray::swap().

Referenced by QTlsPrivate::X509CertificateGeneric::parse(), and read().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toBool()

bool QAsn1Element::toBool ( bool * ok = nullptr) const

Definition at line 194 of file qasn1element.cpp.

References fromBool(), and ok.

+ Here is the call graph for this function:

◆ toDateTime()

QDateTime QAsn1Element::toDateTime ( ) const

Definition at line 211 of file qasn1element.cpp.

References QByteArray::back(), date, QLatin1StringView::first(), QString::fromLatin1(), GeneralizedTimeType, QtMiscUtils::isAsciiDigit(), QDate::isValid(), QTime::isValid(), Q_ASSERT, QByteArray::size(), QLatin1StringView::sliced(), time, QTimeZone::UTC, UtcTimeType, and QDate::year().

+ Here is the call graph for this function:

◆ toInfo()

QMultiMap< QByteArray, QString > QAsn1Element::toInfo ( ) const

Definition at line 255 of file qasn1element.cpp.

References QByteArray::front(), info, SequenceType, and SetType.

+ Here is the call graph for this function:

◆ toInteger()

qint64 QAsn1Element::toInteger ( bool * ok = nullptr) const

Definition at line 275 of file qasn1element.cpp.

References QByteArray::at(), i, IntegerType, QByteArray::isEmpty(), ok, QByteArray::size(), and value().

+ Here is the call graph for this function:

◆ toList()

QList< QAsn1Element > QAsn1Element::toList ( ) const

Definition at line 300 of file qasn1element.cpp.

References items, and SequenceType.

◆ toObjectId()

QByteArray QAsn1Element::toObjectId ( ) const

Definition at line 312 of file qasn1element.cpp.

References QByteArray::at(), i, QByteArray::isEmpty(), QByteArray::number(), ObjectIdentifierType, and QByteArray::size().

Referenced by toObjectName().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toObjectName()

QByteArray QAsn1Element::toObjectName ( ) const

Definition at line 331 of file qasn1element.cpp.

References toObjectId().

+ Here is the call graph for this function:

◆ toString()

QString QAsn1Element::toString ( ) const

Definition at line 337 of file qasn1element.cpp.

References DnsNameType, QString::fromLatin1(), QString::fromUtf8(), PrintableStringType, qstrlen(), Rfc822NameType, QByteArray::size(), TeletexStringType, UniformResourceIdentifierType, and Utf8StringType.

+ Here is the call graph for this function:

◆ type()

quint8 QAsn1Element::type ( ) const
inline

Definition at line 132 of file qasn1element_p.h.

Referenced by QTlsPrivate::X509CertificateGeneric::parse().

+ Here is the caller graph for this function:

◆ value()

QByteArray QAsn1Element::value ( ) const
inline

Definition at line 133 of file qasn1element_p.h.

Referenced by QTlsPrivate::X509CertificateGeneric::parse(), and toInteger().

+ Here is the caller graph for this function:

◆ write()

void QAsn1Element::write ( QDataStream & data) const

Definition at line 117 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ operator!=

bool operator!= ( const QAsn1Element & e1,
const QAsn1Element & e2 )
friend

Definition at line 147 of file qasn1element_p.h.

◆ operator==

bool operator== ( const QAsn1Element & e1,
const QAsn1Element & e2 )
friend

Definition at line 144 of file qasn1element_p.h.


The documentation for this class was generated from the following files: