MCPcopy Index your code
hub / github.com/python/cpython / _ASN1Object

Class _ASN1Object

Lib/ssl.py:394–412  ·  view source on GitHub ↗

ASN.1 object identifier lookup

Source from the content-addressed store, hash-verified

392
393
394class _ASN1Object(namedtuple("_ASN1Object", "nid shortname longname oid")):
395 """ASN.1 object identifier lookup
396 """
397 __slots__ = ()
398
399 def __new__(cls, oid):
400 return super().__new__(cls, *_txt2obj(oid, name=False))
401
402 @classmethod
403 def fromnid(cls, nid):
404 """Create _ASN1Object from OpenSSL numeric ID
405 """
406 return super().__new__(cls, *_nid2obj(nid))
407
408 @classmethod
409 def fromname(cls, name):
410 """Create _ASN1Object from short name, long name or OID
411 """
412 return super().__new__(cls, *_txt2obj(name, name=True))
413
414
415class Purpose(_ASN1Object, _Enum):

Callers

nothing calls this directly

Calls 1

namedtupleFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…