ASN1C C# Runtime Library  7.8
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
Asn1Type Class Reference
Inheritance diagram for Asn1Type:
Asn1TypeIF Asn1ArrayType Asn1BigInteger Asn1BitString Asn1Boolean Asn1CharString Asn1Choice Asn1Enumerated Asn1Integer Asn1Null Asn1ObjectIdentifier Asn1OctetString Asn1OpenExt Asn1Real Asn1SeqOrSet Asn1SeqSetOf Asn1StringOID Asn1UniversalString Asn1X694OrderElement

Public Member Functions

void _SetKey (byte[] rtkey)
 
virtual void Decode (Asn1BerDecodeBuffer buffer, bool explicitTagging, int implicitLength)
 
virtual void Decode (Asn1BerDecodeBuffer buffer)
 
virtual void Decode (Asn1OerDecodeBuffer buffer)
 
virtual void Decode (Asn1PerDecodeBuffer buffer)
 
virtual void Decode (System.Object reader, System.String xmlURI)
 
virtual void Decode (System.Object reader, System.IO.Stream byteStream)
 
virtual void Decode (Asn1MderDecodeBuffer buffer)
 
virtual void DecodeXML (String buffer, String attrs)
 
virtual int Encode (Asn1BerEncodeBuffer buffer, bool explicitTagging)
 
virtual int Encode (Asn1BerEncodeBuffer buffer)
 
virtual void Encode (Asn1OerEncodeBuffer buffer)
 
virtual void Encode (Asn1PerEncodeBuffer buffer)
 
virtual void Encode (Asn1XerEncoder buffer)
 
virtual void Encode (Asn1XerEncoder buffer, System.String elemName)
 
virtual void Encode (Asn1XmlEncoder buffer)
 
virtual void Encode (Asn1XmlEncoder buffer, System.String elemName, System.String nsPrefix)
 
virtual void Encode (Asn1XmlEncodeBuffer buffer)
 
virtual void Encode (Asn1MderOutputStream buffer)
 
virtual void Encode (Asn1MderOutputStream buffer, bool useCachedLength)
 
virtual void Encode (Asn1BerOutputStream outs, bool explicitTagging)
 
virtual void Encode (Asn1CerOutputStream outs, bool explicitTagging)
 
virtual void Encode (Asn1PerOutputStream outs)
 
void EncodeAsOpenType (Asn1OerEncodeBuffer buffer)
 
virtual void EncodeAttribute (Asn1XmlEncoder buffer, System.String attrName)
 
virtual bool Equals (Asn1Type obj)
 
String GetNonParameterizedTypeName ()
 
virtual void Indent (System.IO.TextWriter outs, int level)
 
virtual bool IsOpenType ()
 
virtual bool MatchTypeName (System.String typeName)
 
virtual void Pdiag (System.String s)
 
virtual void Print (System.IO.TextWriter outs, System.String varName, int level)
 
virtual void Print (System.String varName)
 
void SetNonParameterizedTypeName (String value)
 
virtual void SetOpenType ()
 

Static Public Member Functions

static void _SetKey2 (byte[] rtkey)
 
static void _SetLicLocation (String path)
 
static Asn1Type Decode (Asn1BerDecodeBuffer buffer, Asn1OpenTypeField openTypeField, bool explicitTag, int implicitLength)
 
static Asn1Type Decode (Asn1OerDecodeBuffer buffer, Asn1OpenTypeField openTypeField)
 
static Asn1Type Decode (Asn1PerDecodeBuffer buffer, Asn1OpenTypeField openTypeField)
 
static System.String GetTypeName (short typeCode)
 

Public Attributes

const short BIT_STRING = 3
 
const short BMPString = 30
 
const short BOOLEAN = 1
 
const short DATE = 31
 
const short ENUMERATED = 10
 
const short EOC = 0
 
const short EXTERNAL = 8
 
const short GeneralString = 27
 
const short GeneralTime = 24
 
const short GraphicString = 25
 
const short IA5String = 22
 
const short INTEGER = 2
 
const short NULL = 5
 
const short NumericString = 18
 
const short OBJECT_IDENTIFIER = 6
 
const short ObjectDescriptor = 7
 
const short OCTET_STRING = 4
 
const short OpenType = 99
 
const short PrintableString = 19
 
const short REAL = 9
 
const short RELATIVE_OID_IRI = 36
 
const short RelativeOID = 13
 
const short SEQUENCE = 16
 
const short SET = 17
 
const short T61String = TeletexString
 
const short TeletexString = 20
 
const short TIME = 14
 
const short UniversalString = 28
 
const short UTCTime = 23
 
const short UTF8String = 12
 
const short VideotexString = 21
 
const short VisibleString = 26
 

Static Public Attributes

static readonly Asn1Tag _TAG
 

Properties

virtual String AsnTypeName [get]
 
virtual int Length [get]
 

Detailed Description

This is the base class for all ASN.1 built-in types.

Member Function Documentation

◆ _SetKey()

void _SetKey ( byte []  rtkey)

This method is used with the limited run-time to set a run-time key value generated by the compiler to allow the run-time to operate on the licensed hosts. This is not used in the unlimited redistribution versions.

Parameters
rtkeyRun-time key generated by ASN1C

◆ _SetKey2()

static void _SetKey2 ( byte []  rtkey)
static

This method is used with the limited run-time to set a run-time key value generated by the compiler to allow the run-time to operate on the licensed hosts. This is not used in the unlimited redistribution versions. This is the static version of _SetKey.

Parameters
rtkeyRun-time key generated by ASN1C

◆ _SetLicLocation()

static void _SetLicLocation ( String  path)
static

This method sets a location that the runtime should check for a license file.

Parameters
pathPath to check

References Asn1BerDecodeBuffer.MatchTag(), Asn1Tag.mClass, Asn1Tag.mForm, Asn1Tag.mIDCode, and IntHolder.mValue.

◆ Decode() [1/10]

virtual void Decode ( Asn1BerDecodeBuffer  buffer,
bool  explicitTagging,
int  implicitLength 
)
virtual

This method is used to Decode a message that is encoded in BER or DER format.

Parameters
bufferDecode message buffer object
explicitTaggingFlag indicating explicit tag should be parsed from the encoded type.
implicitLengthLength of the contents field (only required if explicitTagging is false).

Implements Asn1TypeIF.

Reimplemented in Asn1BitString, Asn1OpenType, Asn1Real, Asn1BigInteger, Asn1UniversalString, Asn1OctetString, Asn1OpenExt, Asn1UTCTime, Asn1GeneralizedTime, Asn1StringOID, Asn1ObjectIdentifier, Asn1UTF8String, Asn1Time, Asn1BMPString, Asn1OID_IRI, Asn1Boolean, Asn1ChoiceExt, Asn1StringRelativeOID, Asn1X694OrderElement, Asn1Integer, Asn1RelativeOID, Asn1PrintableString, Asn1T61String, Asn1GeneralString, Asn1NumericString, Asn1VideotexString, Asn1VisibleString, Asn1Date, Asn1GraphicString, Asn1IA5String, Asn1ObjectDescriptor, Asn1TimeOfDay, Asn1DateTime, Asn1Null, Asn1Real10, Asn1Duration, and Asn1RealBase2.

Referenced by Asn1XmlUtil.CaptureElement(), Asn1Type.Decode(), Asn1Type.Encode(), and Asn1Type.EncodeAsOpenType().

◆ Decode() [2/10]

virtual void Decode ( Asn1BerDecodeBuffer  buffer)
virtual

This method is used to Decode a message that is encoded in BER or DER format. This version of the method sets tagging to explicit (Asn1Tag.EXPL) and implicit length to zero.

Parameters
bufferDecode message buffer object

References Asn1Tag.EXPL.

◆ Decode() [3/10]

static Asn1Type Decode ( Asn1BerDecodeBuffer  buffer,
Asn1OpenTypeField  openTypeField,
bool  explicitTag,
int  implicitLength 
)
static

Decode an open type field value from the given buffer.

Parameters
bufferDecode message buffer object
openTypeFieldProvides the actual type.
explicitTagif true, the value to be decoded is preceded by a tag and length, which must first be decoded. Otherwise, implicitLength provides the length of the value to be decoded.
implicitLengthThe length of the value to be decoded if explicitTag was given as false.

References Asn1OpenTypeField.actualType, Asn1BerDecoder.Decode(), Asn1Type.Decode(), and Asn1OpenTypeField.decoder.

◆ Decode() [4/10]

static Asn1Type Decode ( Asn1OerDecodeBuffer  buffer,
Asn1OpenTypeField  openTypeField 
)
static

Decode an open type field value from the given buffer.

Parameters
openTypeFieldDescribes the open type being decoded.

◆ Decode() [5/10]

virtual void Decode ( Asn1OerDecodeBuffer  buffer)
virtual

This method decodes an ASN.1 value into this object, following the Octet Encoding Rules (OER).

This method MUST be overridden by all subclasses, except for Asn1Enumerated and subclasses thereof, in order to implement the correct decode behavior for the corresponding ASN.1 type.

This method MUST NOT be invoked on an Asn1Enumerated object. Such objects are immutable and cannot be decoded into.

This method is used polymorphically when table constraint code is generated and Asn1Type is used as the declared type for an open type.

Reimplemented in Asn1BitString, Asn1Real, Asn1UniversalString, Asn1BigInteger, Asn1Integer, Asn1OctetString, Asn1OpenType, Asn1UTF8String, Asn1BMPString, Asn18BitCharString, Asn1StringOID, Asn1ObjectIdentifier, Asn1Real10, Asn1StringRelativeOID, Asn1OID_IRI, Asn1RelativeOID, Asn1Boolean, Asn1DateTime, Asn1VarWidthCharString, Asn1TimeOfDay, Asn1Duration, Asn1Date, Asn1Null, and Asn1RealBase2.

◆ Decode() [6/10]

static Asn1Type Decode ( Asn1PerDecodeBuffer  buffer,
Asn1OpenTypeField  openTypeField 
)
static

Decode an open type field value from the given buffer.

Parameters
bufferDecode message buffer object
openTypeFieldDescribes the actual type.

◆ Decode() [7/10]

virtual void Decode ( Asn1PerDecodeBuffer  buffer)
virtual

This method is the base implementation of the standard Packed Encoding Rules (PER) Decode method. It throws an exception because it should never be invoked. Inherited class implementes this method in Compiler generated code.

Parameters
bufferPER Encode message buffer object
Exceptions
Asn1Exceptionif invoked directly

Implements Asn1TypeIF.

Reimplemented in Asn1AbstractTime, Asn1Real, Asn1BitString, Asn1OpenType, Asn1UniversalString, Asn1BigInteger, Asn1OctetString, Asn1UTF8String, Asn1OpenExt, Asn1BMPString, Asn1StringOID, Asn1DateTime, Asn1ObjectIdentifier, Asn1TimeOfDay, Asn1Duration, Asn1Real10, Asn1Date, Asn1Boolean, Asn1StringRelativeOID, Asn1OID_IRI, Asn1RelativeOID, Asn1Integer, Asn1ChoiceExt, Asn1Null, Asn1NumericString, Asn1RealBase2, Asn1VarWidthCharString, and Asn18BitCharString.

◆ Decode() [8/10]

virtual void Decode ( System.Object  reader,
System.String  xmlURI 
)
virtual

This method declaration is the signature of the standard XML Encoding Rules (XER) Decode method.

Also throws any IO exception from the parser, possibly from a byte stream or character stream supplied by the application.

Parameters
readerXML reader object
xmlURIURI of a source
Exceptions
Asn1ExceptionThrown, if operation is failed.

Implements Asn1TypeIF.

◆ Decode() [9/10]

virtual void Decode ( System.Object  reader,
System.IO.Stream  byteStream 
)
virtual

This method declaration is the signature of the standard XML Encoding Rules (XER) Decode method.

Also throws any IO exception from the parser, possibly from a byte stream or character stream supplied by the application.

Parameters
readerXML reader object
byteStreamInput byte stream object
Exceptions
Asn1ExceptionThrown, if operation is failed.

Implements Asn1TypeIF.

◆ Decode() [10/10]

virtual void Decode ( Asn1MderDecodeBuffer  buffer)
virtual

This method decodes this object's data from an MDER encoding. The implementation for this class throws an exception. When generating MDER code, subclasses will override this implementation.

Parameters
bufferMDER Decode message buffer object

<throws> IOException Any exception thrown by the underlying stream. </throws> <throws> Asn1Exception Thrown, if operation is failed. </throws>

Implements Asn1TypeIF.

Reimplemented in Asn1OctetString.

◆ DecodeXML()

virtual void DecodeXML ( String  buffer,
String  attrs 
)
virtual

This method decodes the XML content of a simple type.

Parameters
bufferString containing data to be decoded
attrsAttributes string from element tag

Referenced by Asn1XmlUtil.CaptureElement().

◆ Encode() [1/14]

virtual int Encode ( Asn1BerEncodeBuffer  buffer,
bool  explicitTagging 
)
virtual

◆ Encode() [2/14]

virtual int Encode ( Asn1BerEncodeBuffer  buffer)
virtual

This method is used to encode a message in BER or DER format. This version of the method sets tagging to explicit (Asn1Tag.EXPL).

Parameters
bufferDecode message buffer object
Returns
Length of component or negative status value

References Asn1OpenTypeField.actualType, Asn1OerDecoder.Decode(), Asn1Type.Decode(), and Asn1OpenTypeField.decoder.

◆ Encode() [3/14]

virtual void Encode ( Asn1OerEncodeBuffer  buffer)
virtual

This method encodes the ASN.1 value represented by this object, following the Octet Encoding Rules (OER).

This method MUST be overridden by all subclasses in order to implement the correct encode behavior for the corresponding type.

This method is used polymorphically when table constraint code is generated and Asn1Type is used as the declared type for an open type.

Reimplemented in Asn1BitString, Asn1Real, Asn1UniversalString, Asn1BigInteger, Asn1Integer, Asn1OctetString, Asn1OpenType, Asn1UTF8String, Asn1BMPString, Asn18BitCharString, Asn1StringOID, Asn1ObjectIdentifier, Asn1Real10, Asn1StringRelativeOID, Asn1RelativeOID, Asn1OID_IRI, Asn1Boolean, Asn1ChoiceExt, Asn1DateTime, Asn1VarWidthCharString, Asn1TimeOfDay, Asn1Duration, Asn1Date, Asn1Enumerated, Asn1Null, and Asn1OpenExt.

◆ Encode() [4/14]

virtual void Encode ( Asn1PerEncodeBuffer  buffer)
virtual

This method is the base implementation of the standard Packed Encoding Rules (PER) encode method. It throws an exception because it should never be invoked. Inherited class implementes this method in Compiler generated code.

Parameters
bufferPER Encode message buffer object
Exceptions
Asn1Exceptionif invoked directly

Implements Asn1TypeIF.

Reimplemented in Asn1AbstractTime, Asn1BitString, Asn1Real, Asn1UniversalString, Asn1OctetString, Asn1BigInteger, Asn1OpenType, Asn1Integer, Asn1UTF8String, Asn1OpenExt, Asn1StringOID, Asn1BMPString, Asn1ObjectIdentifier, Asn1Real10, Asn1StringRelativeOID, Asn1RelativeOID, Asn1DateTime, Asn1TimeOfDay, Asn1Duration, Asn1Date, Asn1Boolean, Asn1OID_IRI, Asn1ChoiceExt, Asn1NumericString, Asn18BitCharString, Asn1Null, and Asn1VarWidthCharString.

◆ Encode() [5/14]

virtual void Encode ( Asn1XerEncoder  buffer)
virtual

This method is the base implementation of the standard XML Encoding Rules (XER) encode method. This method invokes the generated method with element name set to null. This will cause the ASN.1 type name to be used as the top-level element name.

Also throws any exception thrown by the underlying stream.

Parameters
bufferXER Encode message buffer object
Exceptions
Asn1ExceptionThrown, if operation is failed.

Implements Asn1TypeIF.

Reimplemented in Asn1OpenType, and Asn1OpenExt.

◆ Encode() [6/14]

virtual void Encode ( Asn1XerEncoder  buffer,
System.String  elemName 
)
virtual

This method is the base implementation of the standard XML Encoding Rules (XER) encode method. It throws an exception because it should never be invoked by compiler generated code.

Also throws any exception thrown by the underlying stream.

Parameters
bufferXER Encode message buffer object
elemNameXML element name of item
Exceptions
Asn1Exceptionif invoked directly

Implements Asn1TypeIF.

Reimplemented in Asn1BitString, Asn1Real, Asn1UniversalString, Asn1BigInteger, Asn1Integer, Asn1OctetString, Asn1CharString, Asn1ObjectIdentifier, Asn1StringOID, Asn1RelativeOID, Asn1Real10, Asn1StringRelativeOID, Asn1Boolean, Asn1Enumerated, and Asn1Null.

◆ Encode() [7/14]

virtual void Encode ( Asn1XmlEncoder  buffer)
virtual

This method is the base implementation of the standard XML Encoding as specified in the XML schema standard(asn2xsd). This method invokes the generated method with element name and attribute name set to null. This will cause the ASN.1 type name to be used as the top-level element name.

Also throws any exception thrown by the underlying stream.

Parameters
bufferXML Encode message buffer object
Exceptions
Asn1ExceptionThrown, if operation is failed.

Implements Asn1TypeIF.

Reimplemented in Asn1OpenType, and Asn1OpenExt.

◆ Encode() [8/14]

virtual void Encode ( Asn1XmlEncoder  buffer,
System.String  elemName,
System.String  nsPrefix 
)
virtual

This method is the base implementation of the standard XML Encoding as specified in the XML schema standard(asn2xsd). It throws an exception because it should never be invoked. Inherited class implementes this method in Compiler generated code.

Also throws any exception thrown by the underlying stream.

Parameters
bufferXML Encode message buffer object
elemNameXML element name of item
nsPrefixElement namespace value
Exceptions
Asn1ExceptionThrown, if operation is failed.

Implements Asn1TypeIF.

Reimplemented in Asn1BitString, Asn1AbstractTime, Asn1Real, Asn1UniversalString, Asn1BigInteger, Asn1Integer, Asn1OctetString, Asn1CharString, Asn1ObjectIdentifier, Asn1StringOID, Asn1RelativeOID, Asn1Real10, Asn1StringRelativeOID, Asn1Boolean, Asn1Enumerated, Asn1Null, and Asn1Base64BinaryString.

◆ Encode() [9/14]

virtual void Encode ( Asn1XmlEncodeBuffer  buffer)
virtual

This method is the base implementation of the standard XML Encoding as specified in the XML schema standard(asn2xsd). It invokes the Encode() signature that accepts an implementation of the Asn1XmlEncoder interface.

Also throws any exception thrown by the underlying stream.

Parameters
bufferXML Encode message buffer object
Exceptions
Asn1ExceptionThrown, if operation is failed.

◆ Encode() [10/14]

virtual void Encode ( Asn1MderOutputStream  buffer)
virtual

This method encodes this object's data to an MDER encoding. The implementation for this class invokes Encode(buffer, false). When generating MDER code, subclasses will override this implementation or else will override the Encode(Asn1MderOutputStream, bool) overload. Invoke this method if you are not certain which overload has been overridden by the subclass.

Parameters
bufferMDER Encode message buffer object

<throws> IOException Any exception thrown by the underlying stream. </throws> <throws> Asn1Exception Thrown, if operation is failed. </throws>

Implements Asn1TypeIF.

Reimplemented in Asn1OctetString.

◆ Encode() [11/14]

virtual void Encode ( Asn1MderOutputStream  buffer,
bool  useCachedLength 
)
virtual

This method encodes this object's data to an MDER encoding. The implementation for this class throws an exception. When generating MDER code, subclasses will override this implementation or else will override the Encode(Asn1MderOutputStream) overload. Do not invoke this function unless you are certain the subclass has overridden it.

Parameters
bufferMDER Encode message buffer object
useCachedLengthIndicates whether cached length of encoding should be used. In general, only generated code should pass true.

<throws> IOException Any exception thrown by the underlying stream. </throws> <throws> Asn1Exception Thrown, if operation is failed. </throws>

References Asn1OpenTypeField.actualType, Asn1Type.Decode(), and Asn1OpenTypeField.decoder.

◆ Encode() [12/14]

virtual void Encode ( Asn1BerOutputStream  outs,
bool  explicitTagging 
)
virtual

This method writes to the stream an encoded ASN.1 type value including the UNIVERSAL tag value and length if explicit tagging is specified. This overloaded version uses the Basic Encoding Rules (BER).

Throws, Exception thrown by C# System.IO.Stream for I/O error

Parameters
outsBER Output Stream object
explicitTaggingFlag indicating explicit tagging should be done
Exceptions
Asn1ExceptionThrown, if operation is failed.

Implements Asn1TypeIF.

Reimplemented in Asn1BitString, Asn1Real, Asn1UniversalString, Asn1OctetString, Asn1Integer, Asn1BigInteger, Asn1OpenType, Asn1Real10, Asn1StringOID, Asn1ObjectIdentifier, Asn1OpenExt, Asn1UTF8String, Asn1Boolean, Asn1BMPString, Asn1StringRelativeOID, Asn1UTCTime, Asn1RelativeOID, Asn1GeneralizedTime, Asn1Enumerated, Asn1OID_IRI, Asn1Null, Asn1X694OrderElement, Asn1NumericString, Asn1ChoiceExt, Asn1Time, Asn1DateTime, Asn1TimeOfDay, Asn1Date, Asn1Duration, Asn1PrintableString, Asn1T61String, Asn1GeneralString, Asn1IA5String, Asn1VisibleString, Asn1GraphicString, Asn1ObjectDescriptor, and Asn1VideotexString.

◆ Encode() [13/14]

virtual void Encode ( Asn1CerOutputStream  outs,
bool  explicitTagging 
)
virtual

This method writes to the stream an encoded ASN.1 type value including the UNIVERSAL tag value and length if explicit tagging is specified. This overloaded version uses the Cer Encoding Rules (CER).

Throws, Exception thrown by C# System.IO.Stream for I/O error

Parameters
outsCER Output Stream object
explicitTaggingFlag indicating explicit tagging should be done
Exceptions
Asn1ExceptionThrown, if operation is failed.

Reimplemented in Asn1Real10.

◆ Encode() [14/14]

virtual void Encode ( Asn1PerOutputStream  outs)
virtual

This method is the base implementation of the standard Packed Encoding Rules (PER) encode method using output stream. It throws an exception because it should never be invoked by compiler generated code.

Also throws any exception thrown by the Asn1PerOutputStream.

Parameters
outsPER Output Stream object
Exceptions
Asn1ExceptionThrown, if operation is failed.

Implements Asn1TypeIF.

Reimplemented in Asn1BitString, Asn1Real, Asn1UniversalString, Asn1OctetString, Asn1BigInteger, Asn1Integer, Asn1AbstractTime, Asn1Real10, Asn1OpenType, Asn1ObjectIdentifier, Asn1OpenExt, Asn1UTF8String, Asn1Boolean, Asn1RelativeOID, Asn1BMPString, Asn1OID_IRI, Asn1Null, Asn1X694OrderElement, Asn18BitCharString, Asn1DateTime, Asn1TimeOfDay, Asn1Duration, Asn1Date, Asn1VarWidthCharString, and Asn1ChoiceExt.

◆ EncodeAsOpenType()

void EncodeAsOpenType ( Asn1OerEncodeBuffer  buffer)

This method encodes the ASN.1 value represented by this object, following the Octet Encoding Rules (OER), as the value for the actual type of an open type (i.e., it precedes its encoding with a length).

References Asn1OpenTypeField.actualType, Asn1PerDecoder.Decode(), Asn1Type.Decode(), Asn1OpenTypeField.decoder, Asn1OerEncodeBuffer.EncodeLength(), Asn1OerEncodeBuffer.GetCanonicalMode(), Asn1EncodeBuffer.GetOutputStream(), and Asn1OerEncodeBuffer.SetCanonicalMode().

◆ EncodeAttribute()

virtual void EncodeAttribute ( Asn1XmlEncoder  buffer,
System.String  attrName 
)
virtual

This method is the base implementation of the standard XML Encoding as specified in the XML schema standard(asn2xsd). It throws an exception because it should never be invoked by compiler generated code.

Parameters
bufferXML Encode message buffer object
attrNameXML attribute name of item
attributeElement attribute value

<throws> IOException Any exception thrown by the underlying stream. </throws> <throws> Asn1Exception Thrown, if operation is failed. </throws>

Reimplemented in Asn1Real, Asn1Integer, Asn1OctetString, Asn1Real10, Asn1Boolean, and Asn1Base64BinaryString.

◆ Equals()

virtual bool Equals ( Asn1Type  obj)
virtual

Return true if the two objects are equal. /p> Note: in generated code, we will implement Equals(Asn1Type) rather than Equals(Object) to avoid the need to also implement HashCode. The default implementation here is to invoke Equals(Object). This is acceptable for the runtime classes, which have overridden Equals(Object).

Referenced by Asn1Choice.Equals().

◆ GetNonParameterizedTypeName()

String GetNonParameterizedTypeName ( )

Return this type's NonParameterizedTypeName, if set.

◆ GetTypeName()

static System.String GetTypeName ( short  typeCode)
static

This method will convert a type code into a type name as defined in the X.680 standard..

Parameters
typeCodeType code to be converted
Returns
ASN.1 type name

◆ Indent()

virtual void Indent ( System.IO.TextWriter  outs,
int  level 
)
virtual

This method will indent three spaces in the given print stream. It is used by the print methods to provide a formatted output of an encoded element value.

Parameters
outsPrint stream
levelIndentation level (no of spaces is 3 x this number)

References Diag.Instance(), and Diag.Println().

Referenced by Asn1OpenExt.ShrinkArray().

◆ IsOpenType()

virtual bool IsOpenType ( )
virtual

Returns open type mode for XML encoding/decoding.

Returns
true if open type mode is on.

Implements Asn1TypeIF.

◆ MatchTypeName()

virtual bool MatchTypeName ( System.String  typeName)
virtual

This method is used to check the outer level tag in an XER message to verify it matches the expected value. This method is overridden by generated code. The default implementation always returns true.

Parameters
typeNameType name to compare.
Returns
True if name matches internal name.

◆ Pdiag()

virtual void Pdiag ( System.String  s)
virtual

This is a diagnostics print method. It is a shorthand way to invoke the Diag object's println method.

Parameters
sdiagnostics message to be printed.

◆ Print() [1/2]

virtual void Print ( System.IO.TextWriter  outs,
System.String  varName,
int  level 
)
virtual

This method will format and output a primitive value to the given print stream.

Parameters
outsPrint output stream
varNameName of variable
levelIndentation level

Implements Asn1TypeIF.

Reimplemented in Asn1X694OrderElement, and Asn1ArrayType.

◆ Print() [2/2]

virtual void Print ( System.String  varName)
virtual

This method will format and output a primitive value to the standard console output.

Parameters
varNameName of variable

◆ SetNonParameterizedTypeName()

void SetNonParameterizedTypeName ( String  value)

Set this type's NonParameterizedTypeName. The value is specified, based on the ASN.1 type, by X.680.

◆ SetOpenType()

virtual void SetOpenType ( )
virtual

Sets open type mode for XML encoding/decoding.

Implements Asn1TypeIF.

Member Data Documentation

◆ _TAG

readonly Asn1Tag _TAG
static
Initial value:
= new Asn1Tag(Asn1Tag.UNIV,
Asn1Tag.PRIM, Asn1Type.EOC)

Will hold tag for possible definitions

◆ BIT_STRING

const short BIT_STRING = 3

◆ BMPString

const short BMPString = 30

BMPString type code = 30

Referenced by Asn1BMPString.Decode(), and Asn1BMPString.Encode().

◆ BOOLEAN

const short BOOLEAN = 1

BOOLEAN type code = 1

Referenced by Asn1Boolean.Asn1Boolean().

◆ DATE

const short DATE = 31

DATE type code = 31

Referenced by Asn1Date.Encode().

◆ ENUMERATED

const short ENUMERATED = 10

◆ EOC

const short EOC = 0

EOC type code = 0

Referenced by Asn1BerDecodeContext.Expired(), Asn1Tag.IsEOC(), and Asn1Tag.ToString().

◆ EXTERNAL

const short EXTERNAL = 8

EXTERNAL type code = 8

◆ GeneralString

const short GeneralString = 27

GeneralString type code = 27

Referenced by Asn1GeneralString.Encode().

◆ GeneralTime

const short GeneralTime = 24

GeneralTime type code = 24

◆ GraphicString

const short GraphicString = 25

GraphicString type code = 25

Referenced by Asn1GraphicString.Encode().

◆ IA5String

const short IA5String = 22

IA5String type code = 22

Referenced by Asn1IA5String.Asn1IA5String().

◆ INTEGER

const short INTEGER = 2

◆ NULL

const short NULL = 5

NULL type code = 5

Referenced by Asn1Null.Encode(), and Asn1Null.Equals().

◆ NumericString

const short NumericString = 18

NumericString type code = 18

Referenced by Asn1NumericString.Encode().

◆ OBJECT_IDENTIFIER

const short OBJECT_IDENTIFIER = 6

◆ ObjectDescriptor

const short ObjectDescriptor = 7

ObjectDescriptor type code = 7

Referenced by Asn1ObjectDescriptor.Encode().

◆ OCTET_STRING

const short OCTET_STRING = 4

OCTET_STRING type code = 4

Referenced by Asn1OctetString.CompareTo(), Asn1OctetString.Decode(), and Asn1OctetString.Skip().

◆ OpenType

const short OpenType = 99

OpenType type code = 99

Referenced by Asn1OpenType.GetDataEncoding().

◆ PrintableString

const short PrintableString = 19

PrintableString type code = 19

Referenced by Asn1PrintableString.Encode().

◆ REAL

const short REAL = 9

◆ RELATIVE_OID_IRI

const short RELATIVE_OID_IRI = 36

RELATIVE-OID-IRI type code = 35

Referenced by Asn1RELATIVE_OID_IRI.GetTagNumber().

◆ RelativeOID

const short RelativeOID = 13

◆ SEQUENCE

const short SEQUENCE = 16

SEQUENCE type code = 16

Referenced by Asn1Tag.ToString().

◆ SET

const short SET = 17

SET type code = 17

Referenced by Asn1Tag.ToString().

◆ T61String

const short T61String = TeletexString

T61String type code = TeletexString

Referenced by Asn1T61String.Encode().

◆ TeletexString

const short TeletexString = 20

TeletexString type code = 20

◆ TIME

const short TIME = 14

TIME type code = 14

Referenced by Asn1Time.Asn1Time().

◆ UniversalString

const short UniversalString = 28

UniversalString type code = 28

Referenced by Asn1UniversalString.Decode(), and Asn1UniversalString.Encode().

◆ UTCTime

const short UTCTime = 23

UTCTime type code = 23

Referenced by Asn1UTCTime.CompareTo().

◆ UTF8String

const short UTF8String = 12

UTF8String type code = 12

Referenced by Asn1UTF8String.Decode(), and Asn1UTF8String.Encode().

◆ VideotexString

const short VideotexString = 21

VideotexString type code = 21

Referenced by Asn1VideotexString.Encode().

◆ VisibleString

const short VisibleString = 26

VisibleString type code = 26

Referenced by Asn1VisibleString.Encode().

Property Documentation

◆ AsnTypeName

virtual String AsnTypeName
get

Gets the ASN.1 type name that is associated with this type. The ASN.1 type name is derived from the input specification and cannot be set by users of the class.

Value: The ASN.1 type name for this type.

◆ Length

virtual int Length
get

Gets the length of types that can be bound by a size constraint (BIT STRING, OCTET STRING, character string, and SEQUENCE OF/SET OF). An attempt to invoke it on any other type will cause an exception to be thrown.

Value: Length of item in units (for example, bits for BIT STRING, octets for OCTET STRING, etc.)

Exceptions
Asn1InvalidLengthExceptionif called by type rather than size constrainted (BIT STRING, OCTET STRING, character string, or SEQUENCE OF/SET OF)

Referenced by Asn1ArrayType.Asn1ArrayType(), and Asn1ArrayType.Equals().