Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QAuthenticatorPrivate Class Reference

#include <qauthenticator_p.h>

+ Collaboration diagram for QAuthenticatorPrivate:

Public Types

enum  Method {
  None , Basic , Negotiate , Ntlm ,
  DigestMd5
}
 
enum  Phase {
  Start , Phase1 , Phase2 , Done ,
  Invalid
}
 

Public Member Functions

 QAuthenticatorPrivate ()
 
 ~QAuthenticatorPrivate ()
 
QByteArray calculateResponse (QByteArrayView method, QByteArrayView path, QStringView host)
 
QByteArray digestMd5Response (QByteArrayView challenge, QByteArrayView method, QByteArrayView path)
 
void parseHttpResponse (const QList< QPair< QByteArray, QByteArray > > &, bool isProxy, QStringView host)
 
void updateCredentials ()
 

Static Public Member Functions

static QAuthenticatorPrivategetPrivate (QAuthenticator &auth)
 
static const QAuthenticatorPrivategetPrivate (const QAuthenticator &auth)
 
static QHash< QByteArray, QByteArrayparseDigestAuthenticationChallenge (QByteArrayView challenge)
 
static bool isMethodSupported (QByteArrayView method)
 

Public Attributes

QString user
 
QString extractedUser
 
QString password
 
QVariantHash options
 
Method method
 
QString realm
 
QByteArray challenge
 
bool hasFailed
 
Phase phase
 
QByteArray cnonce
 
int nonceCount
 
QString workstation
 
QString userDomain
 

Detailed Description

Definition at line 35 of file qauthenticator_p.h.

Member Enumeration Documentation

◆ Method

Enumerator
None 
Basic 
Negotiate 
Ntlm 
DigestMd5 

Definition at line 38 of file qauthenticator_p.h.

◆ Phase

Enumerator
Start 
Phase1 
Phase2 
Done 
Invalid 

Definition at line 56 of file qauthenticator_p.h.

Constructor & Destructor Documentation

◆ QAuthenticatorPrivate()

QAuthenticatorPrivate::QAuthenticatorPrivate ( )

Definition at line 376 of file qauthenticator.cpp.

References cnonce, QCryptographicHash::hash(), QCryptographicHash::Md5, nonceCount, QByteArray::number(), QRandomGenerator::system(), and QByteArray::toHex().

+ Here is the call graph for this function:

◆ ~QAuthenticatorPrivate()

QAuthenticatorPrivate::~QAuthenticatorPrivate ( )
default

Member Function Documentation

◆ calculateResponse()

QByteArray QAuthenticatorPrivate::calculateResponse ( QByteArrayView  method,
QByteArrayView  path,
QStringView  host 
)

Definition at line 543 of file qauthenticator.cpp.

References Basic, challenge, DigestMd5, digestMd5Response(), Done, QByteArray::fromBase64(), QByteArray::fromRawData(), QString::isEmpty(), QByteArray::isEmpty(), method, Negotiate, None, Ntlm, password, phase, Phase2, Q_UNUSED, qNtlmPhase1(), qNtlmPhase3(), qstrlen(), qWarning, QByteArray::toBase64(), QString::toLatin1(), and user.

+ Here is the call graph for this function:

◆ digestMd5Response()

QByteArray QAuthenticatorPrivate::digestMd5Response ( QByteArrayView  challenge,
QByteArrayView  method,
QByteArrayView  path 
)

Definition at line 794 of file qauthenticator.cpp.

References challenge, cnonce, digestMd5ResponseHelper(), QByteArray::isEmpty(), method, nonceCount, QByteArray::number(), options, parseDigestAuthenticationChallenge(), password, QByteArray::prepend(), realm, QByteArray::size(), QString::toLatin1(), user, and QHash< Key, T >::value().

Referenced by calculateResponse().

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

◆ getPrivate() [1/2]

static const QAuthenticatorPrivate * QAuthenticatorPrivate::getPrivate ( const QAuthenticator auth)
inlinestatic

Definition at line 76 of file qauthenticator_p.h.

◆ getPrivate() [2/2]

static QAuthenticatorPrivate * QAuthenticatorPrivate::getPrivate ( QAuthenticator auth)
inlinestatic

◆ isMethodSupported()

bool QAuthenticatorPrivate::isMethodSupported ( QByteArrayView  method)
static

Definition at line 412 of file qauthenticator.cpp.

References Qt::CaseInsensitive, method, methods, and Q_ASSERT.

Referenced by QHttpNetworkConnectionPrivate::handleAuthenticateChallenge().

+ Here is the caller graph for this function:

◆ parseDigestAuthenticationChallenge()

QHash< QByteArray, QByteArray > QAuthenticatorPrivate::parseDigestAuthenticationChallenge ( QByteArrayView  challenge)
static

Definition at line 655 of file qauthenticator.cpp.

References challenge, QListSpecialMethodsBase< T >::contains(), d, QByteArray::data(), QByteArray::isEmpty(), options, quote(), QByteArray::size(), QByteArray::split(), and QHash< Key, T >::value().

Referenced by digestMd5Response(), parseHttpResponse(), and verifyDigestMD5().

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

◆ parseHttpResponse()

void QAuthenticatorPrivate::parseHttpResponse ( const QList< QPair< QByteArray, QByteArray > > &  values,
bool  isProxy,
QStringView  host 
)

◆ updateCredentials()

void QAuthenticatorPrivate::updateCredentials ( )

Definition at line 389 of file qauthenticator.cpp.

References QString::clear(), extractedUser, QString::indexOf(), QString::left(), method, QString::mid(), Ntlm, realm, user, and userDomain.

Referenced by parseHttpResponse(), and QAuthenticator::setUser().

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

Member Data Documentation

◆ challenge

QByteArray QAuthenticatorPrivate::challenge

◆ cnonce

QByteArray QAuthenticatorPrivate::cnonce

Definition at line 66 of file qauthenticator_p.h.

Referenced by QAuthenticatorPrivate(), and digestMd5Response().

◆ extractedUser

QString QAuthenticatorPrivate::extractedUser

Definition at line 43 of file qauthenticator_p.h.

Referenced by QAuthenticator::operator=(), and updateCredentials().

◆ hasFailed

bool QAuthenticatorPrivate::hasFailed

Definition at line 54 of file qauthenticator_p.h.

◆ method

◆ nonceCount

int QAuthenticatorPrivate::nonceCount

Definition at line 67 of file qauthenticator_p.h.

Referenced by QAuthenticatorPrivate(), digestMd5Response(), and parseHttpResponse().

◆ options

◆ password

◆ phase

Phase QAuthenticatorPrivate::phase

◆ realm

◆ user

◆ userDomain

QString QAuthenticatorPrivate::userDomain

Definition at line 71 of file qauthenticator_p.h.

Referenced by QAuthenticator::operator=(), and updateCredentials().

◆ workstation

QString QAuthenticatorPrivate::workstation

Definition at line 70 of file qauthenticator_p.h.

Referenced by QAuthenticator::operator=().


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