MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _ASN1Object

Class _ASN1Object

tools/python-3.11.9-amd64/Lib/ssl.py:456–474  ·  view source on GitHub ↗

ASN.1 object identifier lookup

Source from the content-addressed store, hash-verified

454
455
456class _ASN1Object(namedtuple("_ASN1Object", "nid shortname longname oid")):
457 """ASN.1 object identifier lookup
458 """
459 __slots__ = ()
460
461 def __new__(cls, oid):
462 return super().__new__(cls, *_txt2obj(oid, name=False))
463
464 @classmethod
465 def fromnid(cls, nid):
466 """Create _ASN1Object from OpenSSL numeric ID
467 """
468 return super().__new__(cls, *_nid2obj(nid))
469
470 @classmethod
471 def fromname(cls, name):
472 """Create _ASN1Object from short name, long name or OID
473 """
474 return super().__new__(cls, *_txt2obj(name, name=True))
475
476
477class Purpose(_ASN1Object, _Enum):

Callers

nothing calls this directly

Calls 1

namedtupleFunction · 0.90

Tested by

no test coverage detected