Implements interfaces: twisted.words.protocols.jabber.sasl_mechanisms.ISASLMechanism

Implements the DIGEST-MD5 SASL authentication mechanism.

The DIGEST-MD5 SASL authentication mechanism is defined in RFC 2831.

Method __init__
Method getInitialResponse Get the initial client response, if defined for this mechanism.
Method getResponse Get the response to a server challenge.
Method _parse Parses the server challenge.
Method _unparse Create message string from directives.
Method _calculateResponse Calculates response with given encoded parameters.
Method _genResponse Generate response-value.
Method _gen_nonce Undocumented
def __init__(self, serv_type, host, serv_name, username, password): (source)
Parametersserv_typeAn indication of what kind of server authentication is being attempted against. For example, u"xmpp". (type: unicode)
hostThe authentication hostname. Also known as the realm. This is used as a scope to help select the right credentials. (type: unicode)
serv_nameAn additional identifier for the server. (type: unicode)
usernameThe authentication username to use to respond to a challenge. (type: unicode)
usernameThe authentication password to use to respond to a challenge. (type: unicode)
def getInitialResponse(self): (source)

Get the initial client response, if defined for this mechanism.

Returnsinitial client response string. (type: str.)
def getResponse(self, challenge): (source)

Get the response to a server challenge.

Parameterschallengeserver challenge. (type: str.)
Returnsclient response. (type: str.)
def _parse(self, challenge): (source)

Parses the server challenge.

Splits the challenge into a dictionary of directives with values.

Returnschallenge directives and their values. (type: dict of str to str.)
def _unparse(self, directives): (source)

Create message string from directives.

Parametersdirectivesdictionary of directives (names to their values). For certain directives, extra quotes are added, as needed. (type: dict of str to str)
Returnsmessage string. (type: str.)
def _calculateResponse(self, cnonce, nc, nonce, username, password, realm, uri): (source)

Calculates response with given encoded parameters.

ReturnsThe response field of a response to a Digest-MD5 challenge of the given parameters. (type: bytes)
def _genResponse(self, charset, realm, nonce): (source)

Generate response-value.

Creates a response to a challenge according to section 2.1.2.1 of RFC 2831 using the charset, realm and nonce directives from the challenge.

def _gen_nonce(self): (source)
Undocumented
API Documentation for Twisted, generated by pydoctor at 2016-05-18 16:01:36.