OBJECT IDENTIFIER¶
The ASN.1 OBJECT IDENTIFIER (OID) type uniquely identifies objects such as
standards, protocols, and algorithms using a dotted-decimal string notation.
In Python, the generated OBJECT IDENTIFIER class wraps a native
str representing the dotted-decimal OID, e.g., "1.3.6.1.4.1".
Example ASN.1 definition:
MyOid ::= OBJECT IDENTIFIER
which generates a Python class similar to:
class MyOid(_Asn1BasicType[str]):
pass
Conceptual Representation¶
- class _Asn1BasicType[str]
Represents an ASN.1 OBJECT IDENTIFIER.
- __init__(self, value: str | None = None) None
Initializes the OID with an optional dotted-decimal string.
- property value: str
Gets or sets the OID as a dotted-decimal string.
The string must follow the OID syntax, e.g., numbers separated by dots. Validation against this syntax is typically performed.
Usage Notes¶
The OID string represents a hierarchical series of integer nodes separated by dots.
Example of a valid OID string:
"1.2.840.113549.1.1.5"Assignment accepts any valid dotted-decimal string.
RELATIVE-OID¶
The ASN.1 RELATIVE-OID type is similar to OBJECT IDENTIFIER but represents
a relative path in the OID tree, omitting the root nodes.
In Python, RELATIVE-OID is also represented as a native str containing
dot-separated integer arcs.
Example ASN.1 definition:
MyRelOid ::= RELATIVE-OID
which generates a Python class similar to:
class MyRelOid(_Asn1BasicType[str]):
pass
Conceptual Representation¶
- class _Asn1BasicType[str]
Represents an ASN.1 RELATIVE-OID.
- __init__(self, value: str | None = None) None
Initializes the relative OID with an optional dot-separated string.
- property value: str
Gets or sets the relative OID string.
The string consists of dot-separated integers representing arcs relative to some root.