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

Class ClientCertTypeExtension

source code


This class handles the Certificate Type extension (variant sent by client) defined in RFC 6091.

Instance Methods [hide private]
 
__init__(self)
Create an instance of ClientCertTypeExtension
source code
str
__repr__(self)
Return programmer-centric representation of extension
source code
TLSExtension
create(self, certTypes=None)
Return instance of this extension with specified certificate types
source code
ClientCertTypeExtension
parse(self, p)
Parse the extension from binary data
source code

Inherited from TLSExtension: __eq__, write

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

Class Variables [hide private]
Instance Variables [hide private]
list of int certTypes
list of certificate type identifiers (each one byte long)
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.

Inherited from TLSExtension: serverType

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Create an instance of ClientCertTypeExtension

See also: create and parse

Parameters:
  • server - whatever to select ClientHello or ServerHello version for parsing
Overrides: object.__init__

__repr__(self)
(Representation operator)

source code 

Return programmer-centric representation of extension

Returns: str
Overrides: object.__repr__

create(self, certTypes=None)

source code 

Return instance of this extension with specified certificate types

Parameters:
  • certTypes (iterable list of int) - list of certificate types to advertise, all values should be between 0 and 2^8-1 inclusive
Returns: TLSExtension
Raises:
  • ValueError - when the list includes too big or negative integers
Overrides: TLSExtension.create

parse(self, p)

source code 

Parse the extension from binary data

Parameters:
Returns: ClientCertTypeExtension
Raises:
  • SyntaxError - when the size of the passed element doesn't match the internal representation
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 the raw encoding of this 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
Get Method:
unreachable.extType(self) - Return the type of TLS extension, in this case - 9
Type:
int