OIDs and tag numbers, decoded
An OID (Object Identifier) is a numeric path that names something without collisions. 1.2.840.113549.1.1.11 reads iso (1) → org (2) → US (840) → RSA (113549) → pkcs-1 (1) → 1 → sha256WithRSAEncryption. Each number is a child index under the previous node.
How an OID becomes bytes
- The first two numbers X and Y share one byte, 40 × X + Y. 1.2 becomes 42 and 2.5 becomes 85.
- Every later number is written base-128: seven bits per byte, with the top bit set while more bytes follow.
- Wrap the resulting bytes in tag 0x06 and a length.
So 1.2.840.113549.1.1.11 is 06 09 2A 86 48 86 F7 0D 01 01 0B. 840 is 0x86 0x48, and 113549 is 0x86 0xF7 0x0D.
OIDs you meet in certificates
| OID | Name | Use |
|---|---|---|
| 1.2.840.113549.1.1.11 | sha256WithRSAEncryption | RSA signature algorithm |
| 1.2.840.10045.4.3.2 | ecdsa-with-SHA256 | ECDSA signature algorithm |
| 1.2.840.10045.2.1 | id-ecPublicKey | EC public key |
| 1.2.840.113549.1.1.1 | rsaEncryption | RSA key |
| 2.5.4.3 | CN | name attribute |
| 2.5.4.10 | O | name attribute |
| 2.5.29.17 | subjectAltName | domain and IP list |
| 2.5.29.19 | basicConstraints | CA or not |
| 2.5.29.15 | keyUsage | key purpose bits |
| 2.5.29.37 | extKeyUsage | purpose OID list |
| 1.3.6.1.5.5.7.3.1 | serverAuth | TLS server purpose |
| 1.3.101.112 | id-Ed25519 | Ed25519 key and signature |
Universal tag numbers
| Tag | Name | Note |
|---|---|---|
| 0x01 | BOOLEAN | true is 0xFF in DER |
| 0x02 | INTEGER | two's complement, minimal length |
| 0x03 | BIT STRING | first byte counts unused bits |
| 0x04 | OCTET STRING | arbitrary bytes, may contain DER |
| 0x05 | NULL | zero length |
| 0x06 | OBJECT IDENTIFIER | numeric hierarchy |
| 0x0C | UTF8String | UTF-8 text |
| 0x13 | PrintableString | restricted ASCII |
| 0x16 | IA5String | ASCII, used for e-mail and DNS |
| 0x17 | UTCTime | YYMMDDHHMMSSZ |
| 0x18 | GeneralizedTime | YYYYMMDDHHMMSSZ |
| 0x30 | SEQUENCE | ordered children |
| 0x31 | SET | unordered children |
Class and constructed bits
- 0x00 to 0x7F: Universal, standard tags.
- 0x40 to 0x7F: Application, defined by an application standard.
- 0x80 to 0xBF: Context-specific, written [0], [1] by the surrounding structure.
- 0xC0 to 0xFF: Private.
- Adding 0x20 in the same range makes a constructed value: 0x30 = Universal 16 constructed, 0xA0 = Context [0] constructed.
High tag numbers
When the tag number is 31 or more, the low five bits are 11111 and the number follows in base-128. Tag 32 is 1F 20. Certificates rarely use it, but CMS and LDAP structures do.
The dictionary holds only common values. An unknown OID still appears as a dotted number in the tree, and you can match it against the tables above.
Questions
Why are OIDs numbers?
Names vary by language and can collide. A numeric path is administered by registration authorities, so it stays unique worldwide.
Can the first number be greater than 2?
No. The first arc is 0, 1 or 2. An arc of 2 requires the second to be 40 or more, and the first byte is then 80 or above.
How do I trace an OID not in the dictionary?
Search the number in an OID repository (OIDref, oird) or look at the prefix to see which authority defined it. For certificate extensions, read RFC 5280 and the extension's own document.
Press an OID node and watch how the number and name connect.
Open the toolThis guide follows ITU-T X.690 (DER/BER), RFC 5280 (X.509), RFC 5208 (PKCS#8), RFC 5480 (EC public keys), RFC 5915 (EC private keys) and RFC 3279 (ECDSA signatures). Every example is synthetic.