Hello,
       Let us write the given description in fully expanded ASN.1 as given  
below.

Record ::=  SET {  
  name             [0] OCTET STRING,
  address          [1] CHOICE  { 
       binaryAddress  CHOICE { 
            v4Address       [0] OCTET STRING (SIZE(4)), 
            v6Address       [1] OCTET STRING (SIZE(16)) 
         }, 
       textRepresentedAddress  CHOICE { 
            textV4Address   [2] IA5String (SIZE(7..15)), 
            textV6Address   [3] IA5String (SIZE(15..45)) 
         }  
    }  
  } 

Here the "binaryAddress  CHOICE" and "textRepresentedAddress  CHOICE" do not 
contribute any tags to ASN.1 BER encoded data stream and can be eliminated for 
simplicity by combining these two into the enclosing CHOICE. This should result 
in following ASN.1 description.

Record ::=  SET {  
  name             [0] OCTET STRING,
  address          [1] CHOICE  { 
            v4Address       [0] OCTET STRING (SIZE(4)), 
            v6Address       [1] OCTET STRING (SIZE(16)), 
            textV4Address   [2] IA5String (SIZE(7..15)), 
            textV6Address   [3] IA5String (SIZE(15..45)) 
    }  
  } 

In IMPLICIT taging none of the "OCTET STRING" or "IA5String" above will have 
their UNIVERSAL tags encoded into ASN.1 BER. While without the IMPLICIT taging 
each CONTEXT tag should be followed by UNIVERSAL tag of "OCTET STRING" or 
"IA5String" as applicable.

Regards,

Shahid.

---- Piyush Wadhwani <[EMAIL PROTECTED]> wrote: 
> Default Tagging mode is IMPLICIT
> 
> 
> 
> Record              ::=  SET {
> 
> Name [0] OCTET STRING
> 
> address [1] My-Address
> 
> }
> 
> 
> 
> My-Address       ::= Address
> 
> 
> 
> Address            ::= CHOICE  --willl tag for BinaryAddress or
> TextRepresentedAddress Will be present while encoding the address in
> default
> 
> {
> 
>             BinaryAddress   BinaryAddress,
> 
>             TextRepresentedAddress            TextRepresentedAddress
> 
> }
> 
> 
> 
> --if tag would have been given for BinaryAddress and
> TextRepresentedAddress then explicit tagging (which is being used)
> must have been included
> 
> 
> 
> BinaryAddress   ::= CHOICE
> 
> {
> 
>             V4Address                                [0] OCTET STRING 
> (SIZE(4)),
> 
>             V6Address                                [1] OCTET STRING 
> (SIZE(16))
> 
> }
> 
> TextRepresentedAddress            ::= CHOICE
> 
> {
> 
>             TextV4Address                          [2] IA5String 
> (SIZE(7..15)),
> 
>             TextV6Address                          [3] IA5String 
> (SIZE(15..45))
> 
> }
> 
> 
> 
> Thanks
> 
> Piyush
> _______________________________________________
> Asn1 mailing list
> [email protected]
> http://lists.asn1.org/mailman/listinfo/asn1

_______________________________________________
Asn1 mailing list
[email protected]
http://lists.asn1.org/mailman/listinfo/asn1

Reply via email to