Christopher,
Some funda info about Tagging. Others in this forum please excuse me for
going back to basics.

ASN.1 always use octets for encoding (i.e. we strive to use minimal number
of bytes to represent
everything.) So a TAG is represented as follows.

0  1 2  3  4 5  6 7 
C C T  N N N N N

Only Bits 3..7 are used to represent tags. Why?
Coz Bits 3 determines if my content is encoded in primitive or constructed
style.
Bits 0 and 1 are used to represent Class of Tag

So I can have an Application Tag  1 and Context Specific Tag 1, while still
not 
disturbing the Universal Tag 1.

I guess by now, U know where to find the tag?
TAG = (TAG_OCTET & 0x1F)

After getting the Tag, to know what to with it is informed by Bits 0,1,2

To decode A1300C0A8004FFFFFFFF8102FFFF, logically separate octets like this.
A1  30  0C   0A   80 04 FF FF FF FF 81 02 FF FF

As it appears, A1 is Context Specific and is encoded in Constructed Type
The Content length is 0x30 (48) octets

Since this record is contructed.
the First member of this record is of Type 
Tag : 0x0C (12) Universal Primitive encoded UTF8 String
Length : 0x0A (10) bytes long
Value : 0xFFFFFF8102FFFF

Hope this would clear your funda.


regards,
Sathya Narayanan S
RPG Cellular Services Ltd.
GSM : + 91 98410 48051

> -----Original Message-----
> From: Christopher S. Flordeliza [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, January 21, 2002 8:26 AM
> To:   [EMAIL PROTECTED]
> Subject:      [ASN.1] Context-Specific
> 
> Hi Guys,
>     Can anyone help me answer this questions:
>         -What is this context-specific tag class?
>         -How can i encode/decode it?
>         -Is the context-specfic tag number always the same with
> universal? Im having a hard time decoding the tag number of a
> context-specific type tag.
>         -How can i decode the byte stream below.
>          A1300C0A8004FFFFFFFF8102FFFF
> 
>         TAG          LENGHT         VALUE
>          A1 30       0C 0A
>          80            04                 FFFFFFFF
>          81            02                 FFFF
> 
>  Thanks.
> 
> --
> ************************************
> Multitasking: The art of screwing
> things at once....
> 
> CHRISTOPHER S. FLORDELIZA
> 
> ***********************************
> 

Reply via email to