On 10/06/2012 08:42 PM, Ivan Shmakov wrote:
> >> The integer is 42 decimal, or 2A hexadecimal, and it's stored as the > >> third (and the last) octet of the sequence. > > > I don't see any integer there with "openssl asn1parse". > AIUI, X.690 §8.1.2 specifies that there could only be one tag > per value, and the CHOICE above uses “private” tags (PRIVATE 0, > PRIVATE 1) to distinguish the members, instead of the > “universal”, type-encoding tags (such as INTEGER = UNIVERSAL 2.) > There isn't much choice here, actually, as the types of these > CHOICE members just happen to coincide. It looks like a corner case indeed. I do not know what should be the encoding in that case. Do you have any use-case that is affected by this behavior or it is a test example? > > Could be but I've never needed that tool. Maybe given its > > limitations it is a good idea to even remove it. When I need to > > generate structures I use libtasn1 directly. > Honestly, I'd hesitate to write C code when the task at hand > could be accomplished with a higher-level language, such as > Shell (or Perl), which seem to speak in favor of retaining such > command-line tools. > (I hope to check if these tools could be improved by some simple > changes.) Indeed. Would you be interested into augmenting this application? I don't think it is hard to make it a practical tool to generate structures. regards, Nikos
