Deceive Most How does ASN.1 encode an object identifier?
The encoding of a SAN extension value (X.509 = PKIX) is defined in rfc5280 as follows:
SubjectAltName ::= GeneralNames GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName GeneralName ::= CHOICE {
For this CHOICE, your first octet 0x88 is the tag value for context-specific No. 8 (means registered ID), and your second octet 0x05 is the length of the value, which is encoded as 0x2A 0x03 0x04 0x05 0x05. Since this value is the identifier of an object, to decode it, see the encoding section under OBJECT IDENTIFIER in the Kaliski document:
BER encoding. Primitive. The contents of the octets are as follows, where value1, ..., valuen denote the integer values ββof the components in the full identifier of the object:
The first octet has a value of 40 * value1 + value2. (This is unambiguous, since the value 1 is limited to the values ββ0, 1 and 2; the value 2 is equally limited to the range from 0 to 39 when the value 1 is 0 or 1; and, according to X.208, n is always at least 2.)
The following octets, if any, encode the value 3, ..., valuen. Each value is a coded base of 128, the most significant digit of the first, with so many digits, and the most significant bit of each octet, except the last in the encoding of values ββis set to "1."
The first value of the 0x2A octet is the decimal number 42 and 42 = 40 * 1 + 2, so the first two components of the OID are 1 and 2. All other octets do not have their most significant bit, so each of them encode one component: 3 4 5 5. An OID consisting of components 1 2 3 4 5 5 is in the usual abbreviated notation 1.2.3.4.5.5 (but there are other equivalent notations, as shown in Kaliski).
By the way, this OID is not valid, because it must be within a member country with digital code 3 ISO3166, and there is no such country.
source share