Article View: comp.protocols.iso
Article #1305Re: Question on ASN.1 Encodings
From: Mike Gering
Date: Fri, 20 Nov 1992 18:45
Date: Fri, 20 Nov 1992 18:45
34 lines
1582 bytes
1582 bytes
In <1drej9INN8t8@svcase.sp.paramax.com> Steve Case writes: >I am trying to understand the various ASN.1 encoding and I cannot seem >to understand how the indefinite form for the length octets can possibly >work! To make things simple, let me give you a specific example and >hopefully someone can clarify the situation for me. > >Let's assume we are encoding a bitstring value. The particular bitstring >to be encoded is '0900000009'H. If I use the indefinite length format, >wouldn't this be encoded as follows: > > BitString Length Contents > 23 80 000900000009 > > EOC Length > 00 00 > >My question, then, is when decoding this octet stream, how do you know >that the bitstring is '0900000009'H and not '09'H or '090'H or '0900'H >or '09000'H? All three of these seem to be possible decodings? > >Thank you for any assistance you might be able to give me. > >Regards, >Steve Case >scase@planet8.sp.paramax.com > Indefinite length encoding may only be used when the contents are constructed. Your example uses the primitive encoding form for BIT STRING. Mike Gering IBM Dept. E78, Building 673 RTP, NC 27709
Technical Details
Message-ID:
<19921120.110313.724@almaden.ibm.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!vnet.ibm.comReferences:
<1drej9INN8t8@svcase.sp.paramax.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!vnet.ibm.com From: gering@vnet.ibm.com ( Mike Gering ) Message-ID: <19921120.110313.724@almaden.ibm.com> Date: Fri, 20 Nov 92 13:45:27 EST Newsgroups: comp.protocols.iso Subject: Re: Question on ASN.1 Encodings Disclaimer: This posting represents the poster's views, not those of IBM News-Software: UReply 3.0 References: <1drej9INN8t8@svcase.sp.paramax.com> Lines: 34