home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / protocol / iso / 1368 < prev    next >
Encoding:
Text File  |  1992-11-20  |  1.8 KB  |  53 lines

  1. Newsgroups: comp.protocols.iso
  2. Path: sparky!uunet!walter!wrench!tain
  3. From: tain@wrench.bae.bellcore.com (Tai Nguyen)
  4. Subject: Re: Question on ASN.1 Encodings
  5. Message-ID: <1992Nov20.165516.17360@walter.bellcore.com>
  6. Sender: news@walter.bellcore.com
  7. Nntp-Posting-Host: wrench.bae.bellcore.com
  8. Organization: Bell Communications Research
  9. References:  <1drej9INN8t8@svcase.sp.paramax.com>
  10. Date: Fri, 20 Nov 92 16:55:16 GMT
  11. Lines: 40
  12.  
  13. In article <1drej9INN8t8@svcase.sp.paramax.com>, scase@email.sp.paramax.com (Steve Case) writes:
  14. |> I am trying to understand the various ASN.1 encoding and I cannot seem
  15. |> to understand how the indefinite form for the length octets can possibly
  16. |> work!  To make things simple, let me give you a specific example and
  17. |> hopefully someone can clarify the situation for me.
  18. |> 
  19. |> Let's assume we are encoding a bitstring value.  The particular bitstring
  20. |> to be encoded is '0900000009'H.  If I use the indefinite length format, 
  21. |> wouldn't this be encoded as follows:
  22. |> 
  23. |>    BitString Length Contents
  24. |>    23        80     000900000009
  25. |> 
  26. |>    EOC       Length
  27. |>    00        00
  28. |> 
  29. |> 
  30. |> My question, then, is when decoding this octet stream, how do you know
  31. |> that the bitstring is '0900000009'H and not '09'H or '090'H or '0900'H
  32. |> or '09000'H?  All three of these seem to be possible decodings?
  33. |> 
  34. Steve,
  35.  
  36. You cannot use indefinite form for a primitive type, e.g. BIT STRING.
  37. Therefore, the answer is your encoding is invalid.
  38.  
  39. Tai
  40.  
  41. |> Thank you for any assistance you might be able to give me.
  42. |> 
  43. |> Regards,
  44. |> Steve Case
  45. |> scase@planet8.sp.paramax.com
  46.  
  47. -- 
  48. ______________________________________________________________________________
  49. Tai Nguyen                Email: ...!bae.bellcore.com!tain
  50. Bell Communication Research         Phone: (908) 699-7934
  51. 444 Hoes Lane Room RRC 1B210
  52. Piscataway NJ, 08854
  53.