ASN1C C# Runtime Library  7.4
Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
Asn1Tag Class Reference

Public Member Functions

 Asn1Tag ()
 
 Asn1Tag (short tagclass, short form, int idCode)
 
virtual bool Equals (short tagclass, short form, int idCode)
 
bool Equals (Asn1Tag tag)
 
virtual bool IsEOC ()
 
override System.String ToString ()
 

Public Attributes

const short APPL = (short) (0x40)
 
const short Bit8Mask = (short) (0x80)
 
const short ClassMask = (short) (0xC0)
 
const short CONS = (short) (0x20)
 
const short CTXT = (short) (0x80)
 
const bool EXPL = true
 
const short EXTIDCODE = (short) (0x1F)
 
const short FormMask = (short) (0x20)
 
const short IDMask = (short) (0x1F)
 
const bool IMPL = false
 
const short L7BitsMask = (short) (0x7f)
 
short mClass
 
short mForm
 
int mIDCode
 
const short PRIM = (short) (0x00)
 
const short PRIV = (short) (0xC0)
 
const short UNIV = (short) (0x00)
 

Static Public Attributes

static readonly Asn1Tag ENUM
 
static readonly Asn1Tag EOC
 
static readonly Asn1Tag SEQUENCE
 
static readonly Asn1Tag SET
 

Properties

virtual bool Constructed [get]
 

Detailed Description

This is a container class for holding the components of an ASN.1 tag value.

Constructor & Destructor Documentation

◆ Asn1Tag() [1/2]

Asn1Tag ( )

The default constructor initializes all fields to zero

◆ Asn1Tag() [2/2]

Asn1Tag ( short  tagclass,
short  form,
int  idCode 
)

This constructor initializes all fields to the given values

Parameters
tagclassTag class value (UNIV, APPL, CTXT, or PRIV)
formTag form value (PRIM or CONS)
idCodeTag identifier code

Member Function Documentation

◆ Equals() [1/2]

virtual bool Equals ( short  tagclass,
short  form,
int  idCode 
)
virtual

This method compares this tag with the given tag value for equality.

Parameters
tagclassTag class value (UNIV, APPL, CTXT, or PRIV)
formTag form value (PRIM or CONS)
idCodeTag identifier code
Returns
true if the specified Tags are equal; otherwise, false.

Referenced by Asn1BerDecodeBuffer.MatchTag().

◆ Equals() [2/2]

bool Equals ( Asn1Tag  tag)

This method compares this tag with the given tag value for equality.

Parameters
tagAsn1Tag object to which this tag is to be compared
Returns
true if the specified Tags are equal; otherwise, false.

References Asn1Tag.mClass, Asn1Tag.mForm, and Asn1Tag.mIDCode.

◆ IsEOC()

virtual bool IsEOC ( )
virtual

This method tests if the tag is an end-of-contents (EOC) tag.

Returns
True if tag is an EOC.

References Asn1Type.EOC.

Referenced by Asn1BerDecodeBuffer.CalcIndefLen(), Asn1BerDecodeBuffer.DecodeOpenType(), and Asn1BerDecodeBuffer.Parse().

◆ ToString()

override System.String ToString ( )

This method will return a formatted string representing the tag value. The form is "[<class> <ID>]" (i.e. the ASN.1 standard syntax for a tag value).

Returns
Formatted tag string

References Asn1Type.ENUMERATED, Asn1Type.EOC, Asn1Type.SEQUENCE, and Asn1Type.SET.

Referenced by Asn1BerDecodeBuffer.DecodeTag(), and Asn1BerMessageDumpHandler.StartElement().

Member Data Documentation

◆ APPL

const short APPL = (short) (0x40)

Mask value for an APPLICATION tag

◆ Bit8Mask

const short Bit8Mask = (short) (0x80)

Bit 8 (MSB) octet mask value

Referenced by Asn1BerDecodeBuffer.DecodeTag().

◆ ClassMask

const short ClassMask = (short) (0xC0)

Mask value to mask the class bits from a tag

Referenced by Asn1BerDecodeBuffer.DecodeTag().

◆ CONS

const short CONS = (short) (0x20)

◆ CTXT

const short CTXT = (short) (0x80)

Mask value for a context-specific tag

◆ ENUM

readonly Asn1Tag ENUM
static

ASN.1 ENUMERATED type tag value

◆ EOC

readonly Asn1Tag EOC
static

◆ EXPL

const bool EXPL = true

This specifies that explicit tagging should be used.

Referenced by Asn1Type.Decode().

◆ EXTIDCODE

const short EXTIDCODE = (short) (0x1F)

Mask value for extended tag identifier indicator

Referenced by Asn1BerDecodeBuffer.DecodeTag(), Asn1BerOutputStream.EncodeTag(), and Asn1BerEncodeBuffer.EncodeTag().

◆ FormMask

const short FormMask = (short) (0x20)

Mask value to mask the form bit from a tag

Referenced by Asn1BerDecodeBuffer.DecodeTag().

◆ IDMask

const short IDMask = (short) (0x1F)

Mask value to mask the tag ID bits from a tag

Referenced by Asn1BerDecodeBuffer.DecodeTag().

◆ IMPL

const bool IMPL = false

This specifies that implicit tagging should be used.

◆ L7BitsMask

const short L7BitsMask = (short) (0x7f)

Lower 7 bits octet mask value

Referenced by Asn1BerDecodeBuffer.DecodeLength(), and Asn1BerDecodeBuffer.DecodeTag().

◆ mClass

short mClass

◆ mForm

short mForm

◆ mIDCode

int mIDCode

◆ PRIM

const short PRIM = (short) (0x00)

◆ PRIV

const short PRIV = (short) (0xC0)

Mask value for a PRIVATE tag

◆ SEQUENCE

readonly Asn1Tag SEQUENCE
static

ASN.1 SEQUENCE type tag value

◆ SET

readonly Asn1Tag SET
static

ASN.1 SET type tag value

◆ UNIV

const short UNIV = (short) (0x00)

Property Documentation

◆ Constructed

virtual bool Constructed
get