Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qsslsocket_qt.cpp File Reference
#include "qasn1element_p.h"
#include <QtCore/qbytearray.h>
#include <QtCore/qdatastream.h>
#include <QtCore/qmessageauthenticationcode.h>
#include <QtCore/qrandom.h>
#include <QtNetwork/private/qsslsocket_p.h>
#include <QtNetwork/private/qsslkey_p.h>
+ Include dependency graph for qsslsocket_qt.cpp:

Go to the source code of this file.

Functions

static QT_BEGIN_NAMESPACE QAsn1Element wrap (quint8 type, const QAsn1Element &child)
 
static QAsn1Element _q_PKCS7_data (const QByteArray &data)
 
static QByteArray _q_PKCS12_keygen (char id, const QByteArray &salt, const QString &passPhrase, int n, int r)
 PKCS #12 key derivation.
 
static QByteArray _q_PKCS12_salt ()
 
static QByteArray _q_PKCS12_certBag (const QSslCertificate &cert)
 
static QAsn1Element _q_PKCS12_key (const QSslKey &key)
 
static QByteArray _q_PKCS12_shroudedKeyBag (const QSslKey &key, const QString &passPhrase, const QByteArray &localKeyId)
 
static QByteArray _q_PKCS12_bag (const QList< QSslCertificate > &certs, const QSslKey &key, const QString &passPhrase)
 
static QAsn1Element _q_PKCS12_mac (const QByteArray &data, const QString &passPhrase)
 
QByteArray _q_makePkcs12 (const QList< QSslCertificate > &certs, const QSslKey &key, const QString &passPhrase)
 

Function Documentation

◆ _q_makePkcs12()

QByteArray _q_makePkcs12 ( const QList< QSslCertificate > &  certs,
const QSslKey key,
const QString passPhrase 
)

Definition at line 249 of file qsslsocket_qt.cpp.

References _q_PKCS12_bag(), _q_PKCS12_mac(), _q_PKCS7_data(), ba, certs, QAsn1Element::fromInteger(), QAsn1Element::fromVector(), items, QAsn1Element::write(), and QIODeviceBase::WriteOnly.

+ Here is the call graph for this function:

◆ _q_PKCS12_bag()

static QByteArray _q_PKCS12_bag ( const QList< QSslCertificate > &  certs,
const QSslKey key,
const QString passPhrase 
)
static

Definition at line 200 of file qsslsocket_qt.cpp.

References _q_PKCS12_certBag(), _q_PKCS12_shroudedKeyBag(), _q_PKCS7_data(), ba, certs, QAsn1Element::fromVector(), i, items, QCryptographicHash::Sha1, QAsn1Element::write(), and QIODeviceBase::WriteOnly.

Referenced by _q_makePkcs12().

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

◆ _q_PKCS12_certBag()

static QByteArray _q_PKCS12_certBag ( const QSslCertificate cert)
static

Definition at line 108 of file qsslsocket_qt.cpp.

References ba, cert, QAsn1Element::Context0Type, QAsn1Element::fromObjectId(), QAsn1Element::fromVector(), items, QAsn1Element::OctetStringType, QAsn1Element::SequenceType, QAsn1Element::SetType, QCryptographicHash::Sha1, wrap(), QAsn1Element::write(), and QIODeviceBase::WriteOnly.

Referenced by _q_PKCS12_bag().

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

◆ _q_PKCS12_key()

static QAsn1Element _q_PKCS12_key ( const QSslKey key)
static

Definition at line 137 of file qsslsocket_qt.cpp.

References QSsl::Dsa, DSA_ENCRYPTION_OID, QAsn1Element::fromInteger(), QAsn1Element::fromObjectId(), QAsn1Element::fromVector(), QAsn1Element::NullType, QAsn1Element::OctetStringType, Q_ASSERT, QSsl::Rsa, and RSA_ENCRYPTION_OID.

Referenced by _q_PKCS12_shroudedKeyBag().

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

◆ _q_PKCS12_keygen()

static QByteArray _q_PKCS12_keygen ( char  id,
const QByteArray salt,
const QString passPhrase,
int  n,
int  r 
)
static

PKCS #12 key derivation.

Some test vectors: http://www.drh-consultancy.demon.co.uk/test.txt

Definition at line 44 of file qsslsocket_qt.cpp.

References A, B, ch, QByteArray::data(), QCryptographicHash::hash(), i, j, QByteArray::resize(), QCryptographicHash::Sha1, QString::size(), QByteArray::size(), and QString::unicode().

Referenced by _q_PKCS12_mac(), and _q_PKCS12_shroudedKeyBag().

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

◆ _q_PKCS12_mac()

static QAsn1Element _q_PKCS12_mac ( const QByteArray data,
const QString passPhrase 
)
static

Definition at line 222 of file qsslsocket_qt.cpp.

References _q_PKCS12_keygen(), _q_PKCS12_salt(), QMessageAuthenticationCode::addData(), QAsn1Element::fromInteger(), QAsn1Element::fromObjectId(), QAsn1Element::fromVector(), QAsn1Element::NullType, QAsn1Element::OctetStringType, QMessageAuthenticationCode::result(), and QCryptographicHash::Sha1.

Referenced by _q_makePkcs12().

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

◆ _q_PKCS12_salt()

static QByteArray _q_PKCS12_salt ( )
static

Definition at line 99 of file qsslsocket_qt.cpp.

References QRandomGenerator::global(), i, QByteArray::resize(), and QByteArray::size().

Referenced by _q_PKCS12_mac(), and _q_PKCS12_shroudedKeyBag().

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

◆ _q_PKCS12_shroudedKeyBag()

static QByteArray _q_PKCS12_shroudedKeyBag ( const QSslKey key,
const QString passPhrase,
const QByteArray localKeyId 
)
static

Definition at line 154 of file qsslsocket_qt.cpp.

References _q_PKCS12_key(), _q_PKCS12_keygen(), _q_PKCS12_salt(), ba, QAsn1Element::Context0Type, QTlsPrivate::DesEde3Cbc, QSslKeyPrivate::encrypt(), QAsn1Element::fromInteger(), QAsn1Element::fromObjectId(), QAsn1Element::fromVector(), items, QAsn1Element::OctetStringType, QAsn1Element::SequenceType, QAsn1Element::SetType, wrap(), QAsn1Element::write(), and QIODeviceBase::WriteOnly.

Referenced by _q_PKCS12_bag().

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

◆ _q_PKCS7_data()

static QAsn1Element _q_PKCS7_data ( const QByteArray data)
static

Definition at line 28 of file qsslsocket_qt.cpp.

References QAsn1Element::Context0Type, QAsn1Element::fromObjectId(), QAsn1Element::fromVector(), items, QAsn1Element::OctetStringType, and wrap().

Referenced by _q_makePkcs12(), and _q_PKCS12_bag().

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

◆ wrap()

static QT_BEGIN_NAMESPACE QAsn1Element wrap ( quint8  type,
const QAsn1Element child 
)
static

Definition at line 20 of file qsslsocket_qt.cpp.

References child, and QIODeviceBase::WriteOnly.

Referenced by QQmlJS::Dom::SimpleObjectWrap::SimpleObjectWrap(), _q_PKCS12_certBag(), _q_PKCS12_shroudedKeyBag(), _q_PKCS7_data(), QGeoRectanglePrivate::extendRectangle(), QListViewPrivate::isWrapping(), QQmlJS::Dom::ScriptElements::GenericScriptElement::iterateDirectSubpaths(), QQmlJS::Dom::ScriptElements::BlockStatement::iterateDirectSubpaths(), QQmlJS::Dom::ScriptElements::ForStatement::iterateDirectSubpaths(), QQmlJS::Dom::ScriptElements::IfStatement::iterateDirectSubpaths(), QQmlJS::Dom::ScriptElements::ReturnStatement::iterateDirectSubpaths(), QQmlJS::Dom::ScriptElements::BinaryExpression::iterateDirectSubpaths(), QQmlJS::Dom::ScriptElements::VariableDeclarationEntry::iterateDirectSubpaths(), QQmlJS::Dom::ScriptElements::VariableDeclaration::iterateDirectSubpaths(), QGeoPathPrivate::length(), QQmlLocale::locale(), QAbstractItemModel::match(), QQuickComboBoxPrivate::match(), QQmlVMEMetaObject::metaCall(), QQmlJS::Dom::SimpleObjectWrap::operator*(), QQmlJS::Dom::SimpleObjectWrap::operator*(), QQmlJS::Dom::SimpleObjectWrap::operator->(), QQmlJS::Dom::SimpleObjectWrap::operator->(), QPlainTextEdit::setLineWrapMode(), QTextEdit::setLineWrapMode(), QCompleter::setWrapAround(), QQuickItemView::setWrapEnabled(), QTextOption::setWrapMode(), QListViewPrivate::setWrapping(), QLabelPrivate::updateLabel(), and QTextMarkdownWriter::writeBlock().

+ Here is the caller graph for this function: