twisted.internet.ssl.DistinguishedName(dict)
class documentationtwisted.internet.ssl
View 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'
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 |
Return a multi-line, human-readable representation of this DN.
Returns | (type: str ) |