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

  1. Path: sparky!uunet!cs.utexas.edu!usc!news.service.uci.edu!network.ucsd.edu!ucsbcsl!spectrum.CMC.COM!fennel.acc.com!art
  2. From: art@acc.com (Art Berggreen)
  3. Newsgroups: comp.protocols.iso
  4. Subject: Re: Question on ASN.1 Encodings
  5. Message-ID: <1992Nov21.005429.18843@acc.com>
  6. Date: 21 Nov 92 00:54:29 GMT
  7. References: <1drej9INN8t8@svcase.sp.paramax.com>
  8. Organization: ACC, Advanced Computer Communications
  9. Lines: 33
  10.  
  11. In article <1drej9INN8t8@svcase.sp.paramax.com> scase@email.sp.paramax.com (Steve Case) writes:
  12. >I am trying to understand the various ASN.1 encoding and I cannot seem
  13. >to understand how the indefinite form for the length octets can possibly
  14. >work!  To make things simple, let me give you a specific example and
  15. >hopefully someone can clarify the situation for me.
  16. >
  17. >Let's assume we are encoding a bitstring value.  The particular bitstring
  18. >to be encoded is '0900000009'H.  If I use the indefinite length format, 
  19. >wouldn't this be encoded as follows:
  20. >
  21. >   BitString Length Contents
  22. >   23        80     000900000009
  23. >
  24. >   EOC       Length
  25. >   00        00
  26. >
  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. Indefinite encodings are only legal on constructed types.  Primitive
  33. types must always use definite length encoding.  Thus you can always
  34. find the EOC encoding which terminates the innermost indefinite length
  35. encoding that it terminates.  These things can be nested!!!
  36.  
  37. >Thank you for any assistance you might be able to give me.
  38. >
  39. >Regards,
  40. >Steve Case
  41. >scase@planet8.sp.paramax.com
  42.  
  43. Art
  44.