Package tlslite :: Module extensions :: Class SRPExtension
[hide private]
[frames] | no frames]

Class SRPExtension

source code


This class handles the Secure Remote Password protocol TLS extension defined in RFC 5054.

Instance Methods [hide private]
 
__init__(self)
Create an instance of SRPExtension
source code
str
__repr__(self)
Return programmer-centric description of extension
source code
TLSExtension
create(self, identity=None)
Create and instance of SRPExtension with specified protocols
source code
SRPExtension
parse(self, p)
Parse the extension from on the wire format
source code

Inherited from TLSExtension: __eq__, write

Inherited from TLSExtension (private): _newCreate, _oldCreate

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

Static Methods [hide private]

Inherited from TLSExtension (private): _parseExt

Class Variables [hide private]
Instance Variables [hide private]
bytearray extData
a byte array containing the value of the extension as to be written on the wire
int extType
a 2^16-1 limited integer specifying the type of the extension that it contains, e.g.
bytearray identity
UTF-8 encoding of user name

Inherited from TLSExtension: serverType

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Create an instance of SRPExtension

See also: create and parse

Parameters:
  • server - whether to select ClientHello or ServerHello version for parsing
  • extType - type of extension encoded as an integer, to be used by subclasses
Overrides: object.__init__

__repr__(self)
(Representation operator)

source code 

Return programmer-centric description of extension

Returns: str
Overrides: object.__repr__

create(self, identity=None)

source code 

Create and instance of SRPExtension with specified protocols

Parameters:
  • identity (bytearray) - UTF-8 encoded identity (user name) to be provided to user. MUST be shorter than 2^8-1.
Returns: TLSExtension
Raises:
  • ValueError - when the identity lenght is longer than 2^8-1
Overrides: TLSExtension.create

parse(self, p)

source code 

Parse the extension from on the wire format

Parameters:
Returns: SRPExtension
Raises:
  • SyntaxError - when the data is internally inconsistent
Overrides: TLSExtension.parse

Instance Variable Details [hide private]

extData

a byte array containing the value of the extension as to be written on the wire
Get Method:
unreachable.extData(self) - Return raw data encoding of the extension
Type:
bytearray

extType

a 2^16-1 limited integer specifying the type of the extension that it contains, e.g. 0 indicates server name extension
Type:
int