Package pyxmpp2 :: Package sasl :: Module scram :: Class SCRAMOperations
[hide private]

Class SCRAMOperations


Functions used during SCRAM authentication and defined in the RFC.
Instance Methods [hide private]
 
__init__(self, hash_function_name)
x.__init__(...) initializes x; see help(type(x)) for signature
 
HMAC(self, key, str_)
The HMAC(key, str) function.
 
H(self, str_)
The H(str) function.
 
Hi(self, str_, salt, i)
The Hi(str, salt, i) function.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
 
Normalize(str_)
The Normalize(str) function.
 
XOR(str1, str2)
The XOR operator for two byte strings.
 
escape(data)
Escape the ',' and '=' characters for 'a=' and 'n=' attributes.
 
unescape(data)
Unescape the ',' and '=' characters for 'a=' and 'n=' attributes.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, hash_function_name)
(Constructor)

 
x.__init__(...) initializes x; see help(type(x)) for signature
Overrides: object.__init__
(inherited documentation)

Normalize(str_)
Static Method

 

The Normalize(str) function.

This one also accepts Unicode string input (in the RFC only UTF-8 strings are used).

escape(data)
Static Method

 

Escape the ',' and '=' characters for 'a=' and 'n=' attributes.

Replaces '=' with '=3D' and ',' with '=2C'.

Parameters:
  • data (bytes) - string to escape

unescape(data)
Static Method

 

Unescape the ',' and '=' characters for 'a=' and 'n=' attributes.

Reverse of escape.

Parameters:
  • data (bytes) - string to unescape