QtCraft API C++ classes QML types Handbook

QcDer Namespace

The few DER (ASN.1) encodings a self-signed certificate needs (decision E-872; ITU-T X.690): the structure only, the key and its signature come from QcTlsKey. More...

Header: #include <network/tls/QcDer.h>

Variables

const char[4] commonName

Functions

QByteArray bitString(const QByteArray &bytes)
QByteArray element(quint8 tag, const QByteArray &content)
QByteArray explicitTag(int number, const QByteArray &inner)
QByteArray integer(const QByteArray &bigEndian)
QByteArray integer(quint8 value)
QByteArray objectIdentifier(const QByteArray &encoded)
QByteArray pem(const QByteArray &der, const QByteArray &label)
QByteArray sequence(const QByteArrayList &elements)
QByteArray set(const QByteArrayList &elements)
QByteArray time(const QDateTime &when)
QByteArray utf8String(const QString &text)

Detailed Description

Each function returns one complete element.

Variable Documentation

const char[4] QcDer::commonName

Object identifiers, already encoded (the content of an OBJECT IDENTIFIER).

Function Documentation

QByteArray QcDer::bitString(const QByteArray &bytes)

Returns a BIT STRING of the whole bytes.

QByteArray QcDer::element(quint8 tag, const QByteArray &content)

Returns the element with tag and content: tag, length and content.

QByteArray QcDer::explicitTag(int number, const QByteArray &inner)

Returns the context-specific constructed tag [number] around the element inner.

QByteArray QcDer::integer(const QByteArray &bigEndian)

Returns a non-negative INTEGER from its bigEndian bytes (a serial number).

QByteArray QcDer::integer(quint8 value)

Returns the INTEGER value.

QByteArray QcDer::objectIdentifier(const QByteArray &encoded)

Returns an OBJECT IDENTIFIER with the encoded content (commonName and the like).

QByteArray QcDer::pem(const QByteArray &der, const QByteArray &label)

Returns der as PEM text: base64 in lines of 64 characters between BEGIN and END lines with label.

QByteArray QcDer::sequence(const QByteArrayList &elements)

Returns a SEQUENCE of the encoded elements.

QByteArray QcDer::set(const QByteArrayList &elements)

Returns a SET of the encoded elements.

QByteArray QcDer::time(const QDateTime &when)

Returns when as UTCTime up to 2049, as GeneralizedTime from 2050 on (RFC 5280, 4.1.2.5).

QByteArray QcDer::utf8String(const QString &text)

Returns a UTF8String of text.