When working with encodings of an existing data model then the use of
implicit vs explicit comes down to what the designers specified.  ie. for
interoperability you can't work against the specification.

When designing a data model with ASN.1 I don't know of any specific reason
for using one over the other.  Explicit tags wrapper the underlying object
and as such add a little bloat but leave the underlying encoded object
unchanged.  Implicit tags replace the underlying tag in the encoding,
avoiding the little bloat, but altering the encoded representation of the
underlying object.

For example, the INTEGER zero is encoded in DER as 02 01 00.  Applying a
context-specific tag of 2 results in:
Implicit: 82 01 00
Explicit: 82 03 02 01 00

Regards,

Steven

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of sravan
Sent: Thursday, 8 September 2005 1:55 PM
To: openssl-users@openssl.org
Subject: Re: OCSP, Nonce and the requestExtensions

Hi Steven and others,
i have a doubt regd these tags in ASN1:
when do we use implicit tags & when do we use explicit tags?

i have read the 'layman's guide to a subset of ASN.1, BER & DER' but it
seems i didn't get the exact difference b/n the two types of tags - in the
sense of exact context in which each of these types of tags are used.

bye & thnx
- sravan

Steven Reddie wrote:

>I should clarify that tags aren't blindly used to identify members of 
>structured types, only when there would otherwise be ambiguity such as 
>with optional members in a SEQUENCE, or in a CHOICE.
>
>-----Original Message-----
>From: [EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED] On Behalf Of Steven Reddie
>Sent: Thursday, 8 September 2005 11:07 AM
>To: openssl-users@openssl.org
>Subject: RE: OCSP, Nonce and the requestExtensions
>
>Do a search for a document titled "A Layman's Guide to a Subset of 
>ASN.1, BER, and DER".  The tags in this case, and generally, are used 
>to identify the components in the structure.  Since the last two 
>members are optional it is necessary to encode the structure so that it 
>is possible to tell which of the optional components is present.  I 
>don't know why the version has an explicit tag -- it seems redundant.
>
>  
>

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to