ASN1C C# Runtime Library  7.8
Public Member Functions | Public Attributes | Static Protected Member Functions | Properties | List of all members
Asn1CharString Class Reference
Inheritance diagram for Asn1CharString:
Asn1Type Asn1TypeIF Asn18BitCharString Asn1BMPString Asn1OID_IRI Asn1UTF8String Asn1VarWidthCharString Asn1AbstractTime Asn1Date Asn1DateTime Asn1Duration Asn1IA5String Asn1NumericString Asn1PrintableString Asn1Time Asn1TimeOfDay Asn1VisibleString Asn1RELATIVE_OID_IRI Asn1Real10 Asn1XmlAnyElem Asn1GeneralString Asn1GraphicString Asn1ObjectDescriptor Asn1T61String Asn1VideotexString

Public Member Functions

void DecodeByteToChar (Asn1OerDecodeBuffer buffer, int length)
 
virtual void DecodeXER (System.String buffer, System.String attrs)
 
override void DecodeXML (System.String buffer, System.String attrs)
 
override void Encode (Asn1XerEncoder buffer, System.String elemName)
 
override void Encode (Asn1XmlEncoder buffer, System.String elemName, System.String nsPrefix)
 
bool Equals (System.String value)
 
override bool Equals (System.Object value)
 
override int GetHashCode ()
 
override System.String ToString ()
 
bool validate (Asn1CharSet charSet)
 
- Public Member Functions inherited from Asn1Type
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 (Asn1XmlEncoder buffer)
 
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 ()
 

Public Attributes

System.String mValue
 
- Public Attributes inherited from Asn1Type
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 Protected Member Functions

static void DecodeInternal (Asn1PerDecodeBuffer buffer, System.Text.StringBuilder stringBuffer, int abpc, int ubpc, Asn1CharSet charSet)
 
static int Encode (Asn1BerEncodeBuffer buffer, String val, bool explicitTagging, Asn1Tag tag)
 

Properties

override int Length [get]
 
- Properties inherited from Asn1Type
virtual String AsnTypeName [get]
 
virtual int Length [get]
 

Additional Inherited Members

- Static Public Member Functions inherited from Asn1Type
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)
 
- Static Public Attributes inherited from Asn1Type
static readonly Asn1Tag _TAG
 

Detailed Description

This is a container class for holding the components of an ASN.1 character string value. Subclasses are defined for all of the different string types.

Member Function Documentation

◆ DecodeByteToChar()

void DecodeByteToChar ( Asn1OerDecodeBuffer  buffer,
int  length 
)

This method decodes a given number of bytes and converts each byte to a char having the same value.

◆ DecodeInternal()

static void DecodeInternal ( Asn1PerDecodeBuffer  buffer,
System.Text.StringBuilder  stringBuffer,
int  abpc,
int  ubpc,
Asn1CharSet  charSet 
)
staticprotected

This method decodes an ASN.1 character string value in accordance with the packed encoding rules (PER). This version of the method assumes that a permitted alphabet constraint has been specified that would reduce the the number of bits-per-character from the default character set. It also assumes a general length determinant is present (i.e. there is not size constraint). The decoded result is stored in the given StringBuilder, which may be null.

Parameters
bufferDecode message buffer object
stringBufferIf not null, receives the decoded result.
abpcNumber of bits per character (aligned)
ubpcNumber of bits per character (unaligned)
charSetObject representing the permitted alphabet constraint character set (optional)

◆ DecodeXER()

virtual void DecodeXER ( System.String  buffer,
System.String  attrs 
)
virtual

This method decodes ASN.1 8-bit character string types including IA5String, PrintableString, NumericString, etc. using the XML encoding rules (XER).

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

References Asn1XmlXerEncoder.EncodeData(), Asn1XmlEncoder.EncodeEndElement(), and Asn1XmlEncoder.EncodeStartElement().

◆ DecodeXML()

override void DecodeXML ( System.String  buffer,
System.String  attrs 
)

This method decodes ASN.1 8-bit character string types including IA5String, PrintableString, NumericString, etc. using the XML Schema encoding rules(asn2xsd).

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

◆ Encode() [1/3]

static int Encode ( Asn1BerEncodeBuffer  buffer,
String  val,
bool  explicitTagging,
Asn1Tag  tag 
)
staticprotected

This method encodes ASN.1 8-bit character string types including IA5String, PrintableString, NumericString, etc. The UNIVERSAL tag value and length is also encoded if explicit tagging is specified (the universal identifier must be provided by the caller).

Parameters
bufferEncode message buffer object
explicitTaggingFlag indicating explicit tagging should be done
tagUniversal tag to apply
Returns
Length in octets of encoded component

◆ Encode() [2/3]

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

This method encodes ASN.1 8-bit character string types including IA5String, PrintableString, NumericString, etc. using the XML encoding rules (XER).

Parameters
bufferEncode message buffer object
elemNameXML element name used to wrap string

Reimplemented from Asn1Type.

Reimplemented in Asn1Real10.

◆ Encode() [3/3]

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

This method encodes ASN.1 8-bit character string types including IA5String, PrintableString, NumericString, etc. using the XML Encoding as specified in the XML schema standard(asn2xsd).

Parameters
bufferEncode message buffer object
elemNameXML element name used to wrap string
nsPrefixXML element namespace value

Reimplemented from Asn1Type.

Reimplemented in Asn1Real10.

◆ Equals() [1/2]

bool Equals ( System.String  value)

This method compares this character string value to the given value for equality.

Parameters
valueThe String value to compare with the current Object.
Returns
true if the specified string is equal to the current Object; otherwise, false.

◆ Equals() [2/2]

override bool Equals ( System.Object  value)

This method compares this character string value to the given value for equality.

Parameters
valueThe Object to compare with the current Object. Object should be instance of Asn1CharString.
Returns
true if the specified Object is equal to the current Object; otherwise, false.

References Asn1CharString.mValue.

◆ GetHashCode()

override int GetHashCode ( )

Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.

Returns
A hash code for the current Object.

◆ ToString()

override System.String ToString ( )

This method will return a string representation of the value. The format is the ASN.1 value format for this type..

Returns
Stringified representation of the value

References Asn1PerMessageBuffer.ByteAlign(), and Asn1PerMessageBuffer.IsAligned().

◆ validate()

bool validate ( Asn1CharSet  charSet)

Member Data Documentation

◆ mValue

System.String mValue

The mValue public member variable is used to hold the string value to be encoded or the results of a Decode operation.

Referenced by Asn1XmlAnyElem.XsdAnySaxHandler.EndElement(), and Asn1CharString.Equals().

Property Documentation

◆ Length

override int Length
get

Gets the length of the character string in characters.

Value: Number of characters.