home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / protocol / iso / 1370 < prev    next >
Encoding:
Internet Message Format  |  1992-11-20  |  1.5 KB

  1. Path: sparky!uunet!vnet.ibm.com
  2. From: gering@vnet.ibm.com ( Mike Gering )
  3. Message-ID: <19921120.110313.724@almaden.ibm.com>
  4. Date: Fri, 20 Nov 92 13:45:27 EST
  5. Newsgroups: comp.protocols.iso
  6. Subject: Re: Question on ASN.1 Encodings
  7. Disclaimer: This posting represents the poster's views, not those of IBM
  8. News-Software: UReply 3.0
  9. References: <1drej9INN8t8@svcase.sp.paramax.com>
  10. Lines: 34
  11.  
  12. In <1drej9INN8t8@svcase.sp.paramax.com> Steve Case writes:
  13. >I am trying to understand the various ASN.1 encoding and I cannot seem
  14. >to understand how the indefinite form for the length octets can possibly
  15. >work!  To make things simple, let me give you a specific example and
  16. >hopefully someone can clarify the situation for me.
  17. >
  18. >Let's assume we are encoding a bitstring value.  The particular bitstring
  19. >to be encoded is '0900000009'H.  If I use the indefinite length format,
  20. >wouldn't this be encoded as follows:
  21. >
  22. >   BitString Length Contents
  23. >   23        80     000900000009
  24. >
  25. >   EOC       Length
  26. >   00        00
  27. >
  28. >My question, then, is when decoding this octet stream, how do you know
  29. >that the bitstring is '0900000009'H and not '09'H or '090'H or '0900'H
  30. >or '09000'H?  All three of these seem to be possible decodings?
  31. >
  32. >Thank you for any assistance you might be able to give me.
  33. >
  34. >Regards,
  35. >Steve Case
  36. >scase@planet8.sp.paramax.com
  37. >
  38. Indefinite length encoding may only be used when the contents are
  39. constructed.  Your example uses the primitive encoding form for
  40. BIT STRING.
  41.  
  42. Mike Gering
  43. IBM
  44. Dept. E78, Building 673
  45. RTP, NC 27709
  46.