class documentation

class twisted.internet.ssl.DistinguishedName(dict): (source)

View In Hierarchy

Identify and describe an entity.

Distinguished names are used to provide a minimal amount of identifying information about a certificate issuer or subject. They are commonly created with one or more of the following fields:

    commonName (CN)
    organizationName (O)
    organizationalUnitName (OU)
    localityName (L)
    stateOrProvinceName (ST)
    countryName (C)
    emailAddress

A DistinguishedName should be constructed using keyword arguments whose keys can be any of the field names above (as a native string), and the values are either Unicode text which is encodable to ASCII, or bytes limited to the ASCII subset. Any fields passed to the constructor will be set as attributes, accessible using both their extended name and their shortened acronym. The attribute values will be the ASCII-encoded bytes. For example:

    >>> dn = DistinguishedName(commonName=b'www.example.com',
    ...                        C='US')
    >>> dn.C
    b'US'
    >>> dn.countryName
    b'US'
    >>> hasattr(dn, "organizationName")
    False

DistinguishedName instances can also be used as dictionaries; the keys are extended name of the fields:

    >>> dn.keys()
    ['countryName', 'commonName']
    >>> dn['countryName']
    b'US'
Class Variable __slots__ Undocumented
Method __init__ Undocumented
Method __repr__ Undocumented
Method __getattr__ Undocumented
Method __setattr__ Undocumented
Method inspect Return a multi-line, human-readable representation of this DN.
Method _copyFrom Undocumented
Method _copyInto Undocumented
__slots__ = (source)

Undocumented

(type: tuple)
def __init__(self, **kw): (source)

Undocumented

def _copyFrom(self, x509name): (source)

Undocumented

def _copyInto(self, x509name): (source)

Undocumented

def __repr__(self): (source)

Undocumented

ReturnsUndocumented (type: str)
def __getattr__(self, attr): (source)

Undocumented

def __setattr__(self, attr, value): (source)

Undocumented

def inspect(self): (source)

Return a multi-line, human-readable representation of this DN.

ReturnsUndocumented (type: str)
API Documentation for Twisted, generated by pydoctor 20.12.1 at 2021-02-28 19:53:36.