ASN.1 object identifier lookup
| 454 | |
| 455 | |
| 456 | class _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 | |
| 477 | class Purpose(_ASN1Object, _Enum): |
nothing calls this directly
no test coverage detected