Hi there,
We have been looking at ASN.1 (BER) for a while and there are a couple of
things we're not sure about, so we were wondering if anyone could help us
out?
If an ASN.1 module uses automatic tagging, and the following is part of the
specification:
Message ::= SEQUENCE
{
header Header,
trans Transaction OPTIONAL
}
Header ::=CHOICE
{
parmIndex Index,
seqNum SequenceNum
}
Index ::= OCTET STRING(SIZE(4))
SequenceNum ::= OCTET STRING(SIZE(4))
Would the correct encoding of a seqNum be
3080 (open Message)
A080 (open Header)
810401020304 (tag for seqNum followed by length and value)
0000
0000
or
3080 (open Message)
A080 (open Header)
A180 (external tag for seqNum)
040401020304 (internal tag for seqNum followed by
length and value)
0000
0000
0000
i.e. does the fact that a CHOICE needs to be explicitly tagged mean that the
seqNum has an
'external' and 'internal' tag?
If the first encoding option above is correct, how would the encoding differ
if Header
was a SEQUENCE (and parmIndex was OPTIONAL)?
Thanks in advance for your help.
Regards,
Mark Mitchell
-------
Mark Mitchell
Voice Networking Group
Data Connection Ltd
Tel: +44 20 8366 1177
Fax: +44 20 8363 1468
Email: [EMAIL PROTECTED]
Web: http://www.dataconnection.com