Yes I do second this. The purpose we need to know encoding and decoding is for a. Know why it is encoded the way it is. b. to understand how a ASN.1 compiler works.
It is useful for programmers who do not use any standard compilers, but develop their own code for coding/decoding ASN.1 octet stream. One might wonder why would anyone want to do this himslef while compilers are available. In custom binary protocol implementations where complicated ASN.1 definitions are not used and considering the overhead - performance balance, one might choose to write his own coding/decoding routines. regards, Sathya Narayanan S RPG Cellular Services Limited GSM : +91 98410 48051 > -----Original Message----- > From: Phil Griffin > Sent: Saturday, November 17, 2001 8:00 PM > To: [EMAIL PROTECTED] > Subject: Re: [ASN.1] itu-t (0) recommendation (0) h (8) 245 version > (0) 2 > > Just my opinion. But a receiver should rarely need to > decode an OID. OIDs are constants usually tied to > processing semantics (as with an algorithm identifier) > and used as a switch in an application. > > Once you've encoded each OID you expect at a given > point in your application and defined these encodings > in your application as a list of known hex blobs, all > you need do to determine that a given OID hex blob you > receive in a message is some particular OID is to just > compare the encoded OID blob receive against your set of > expected OID constants. > > Decoding the blob you receive is a waste of effort. It > gains you little unless you perhaps intend to display > the value, or reformat the encoding, say from BER into > the XER dotted format, and pass it along for further > processing. > > Phil Griffin > > > > William Of Ockham wrote: > > > > What does it mean to "evaluate" an object identifier, I mean, "resolve" > it? > > > > I'm curious to know how the recipient uses an object identifier once > he's got > > it. > > > > William > > > > --- "Sathya[IT]" <[EMAIL PROTECTED]> wrote: > > > Hi Justin, > > > > > > Long ago, back in 1986, ASN.1 specification considered a wastage of > octets > > > to use 2 bytes for the first 2 roots. So they juxtaposed both into a > single > > > octet using the formula Root * 40 + Second root. This was due to the > fact > > > that there ar only 3 root nodes (ITU-T, ISO and Joint ISO-ITU). Since > the > > > values of OID are encoded in 7Bit encoded Integer. We can have only > 128 > > > values for this juxtaposed integer to be represented in a single > octet. > > > 128/3 is approx. 40. > > > The first 40 is given to ITU-T, the next 40 to ISO and the rest to > joint > > > iso-itu. This also explains why the second level arc cannot have more > than > > > 40 siblings. > > > > > > Hope this will clarify your doubt. > > > > > > regards, > > > > > > Sathya Narayanan S > > > RPG Cellular Services Limited > > > GSM : +91 98410 48051 > > > > > > > -----Original Message----- > > > > From: Hwang, Justin > > > > Sent: Thursday, November 15, 2001 10:13 PM > > > > To: '[EMAIL PROTECTED]' > > > > Subject: RE: [ASN.1] itu-t (0) recommendation (0) h (8) 245 > version > > > > (0) 2 > > > > > > > > Hi, > > > > > > > > I never decode OBJECT ID before, so please > > > > help me with the following questions. > > > > > > > > > itu-t (0) recommendation (0) h (8) 245 version (0) 2 > > > > > 1) 40 * 0 + 0 = 0 > > > > > > > > ===> Why 40? where 40 comes from? and why only 1 byte for both > "itu-t (0) > > > > recommendation (0)"? why not 2 bytes? 1 byte (0) for itu-t and other > byte > > > > (0) for recommendation? > > > > > > > > > 2) 8 > > > > > 3+4) 245 = 11110101B => 1 0000001 0 1110101 = F1 75 > > > > > > > > ===> How "11110101B" is converted to "1 0000001 0 1110101"? > > > > > > > > > 5) 0 > > > > > 6) 2 > > > > > > > > > > > > Thanks! > > > > > > > > Justin > > > > > > > > > > > > -----Original Message----- > > > > From: Sathya[IT] [mailto:[EMAIL PROTECTED]] > > > > Sent: Thursday, November 15, 2001 3:35 AM > > > > To: [EMAIL PROTECTED] > > > > Subject: RE: [ASN.1] itu-t (0) recommendation (0) h (8) 245 version > (0) > > > > 2 > > > > > > > > > > > > Hi Bernd, > > > > > > > > While I encode this, the octets turn out to be 00 08 81 75 00 02 > > > > > > > > I dont understand how you arrived at f1 instead of 81. Is there a > > > > significance > > > > for the deviation? > > > > > > > > regards, > > > > > > > > Sathya Narayanan S > > > > RPG Cellular Services Limited > > > > GSM : +91 98410 48051 > > > > > > > > > -----Original Message----- > > > > > From: Bernd Kunze > > > > > Sent: Monday, November 05, 2001 9:15 PM > > > > > To: '[EMAIL PROTECTED]' > > > > > Subject: RE: [ASN.1] itu-t (0) recommendation (0) h (8) 245 > version > > > > > (0) 2 > > > > > > > > > > Hi, > > > > > > > > > > itu-t (0) recommendation (0) h (8) 245 version (0) 2 > > > > > > > > > > 1) 40 * 0 + 0 = 0 > > > > > 2) 8 > > > > > 3+4) 245 = 11110101B => 1 0000001 0 1110101 = F1 75 > > > > > 5) 0 > > > > > 6) 2 > > > > > > > > > > => 00 08 F1 75 00 02 > > > > > > > > > > Bernd > > > > __________________________________________________ > > Do You Yahoo!? > > Find the one for you at Yahoo! Personals > > http://personals.yahoo.com
