Asn1CharString Class Reference
Public Member Functions | |
virtual void | DecodeXER (System.String buffer, System.String attrs) |
override void | DecodeXML (System.String buffer, System.String attrs) |
virtual void | Encode (Asn1XmlEncoder buffer, System.String elemName, System.String nsPrefix) |
override void | Encode (Asn1XerEncoder buffer, System.String elemName) |
override bool | Equals (System.Object value) |
bool | Equals (System.String value) |
override int | GetHashCode () |
override System.String | ToString () |
bool | validate (Asn1CharSet charSet) |
Public Attributes | |
System.String | mValue |
Protected Member Functions | |
internal | Asn1CharString (System.String data, short typeCode) |
internal | Asn1CharString (short typeCode) |
virtual internal void | Decode (Asn1PerDecodeBuffer buffer, int abpc, int ubpc, Asn1CharSet charSet, long lower, long upper) |
virtual internal void | Decode (Asn1PerDecodeBuffer buffer, int abpc, int ubpc, Asn1CharSet charSet) |
virtual internal void | Decode (Asn1BerDecodeBuffer buffer, bool explicitTagging, int implicitLength, Asn1Tag tag) |
virtual internal void | Encode (Asn1PerEncodeBuffer buffer, int abpc, int ubpc, Asn1CharSet charSet, long lower, long upper) |
virtual internal void | Encode (Asn1PerEncodeBuffer buffer, int abpc, int ubpc, Asn1CharSet charSet) |
virtual internal int | Encode (Asn1BerEncodeBuffer buffer, bool explicitTagging, Asn1Tag tag) |
Protected Attributes | |
internal System.Text.StringBuilder | mStringBuffer |
Properties | |
override int | Length [get] |
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.
Constructor & Destructor Documentation
internal Asn1CharString | ( | short | typeCode | ) | [protected] |
This constructor creates an empty string that can be used in a Decode method call to receive a string value.
- Parameters:
-
typeCode Universal ID code for ASN.1 character string
internal Asn1CharString | ( | System.String | data, | |
short | typeCode | |||
) | [protected] |
This constructor initializes a character string from the given string data.
- Parameters:
-
data Character string typeCode Universal ID code for ASN.1 character string
Member Function Documentation
virtual internal void Decode | ( | Asn1PerDecodeBuffer | buffer, | |
int | abpc, | |||
int | ubpc, | |||
Asn1CharSet | charSet, | |||
long | lower, | |||
long | upper | |||
) | [protected, virtual] |
This overloaded version of the Decode method decodes an ASN.1 character string value in accordance with the packed encoding rules (PER). This version of the method assumes a size constraint is present but no permitted alphabet constraint.
The decoded result is stored in the public mValue
member variable.
- Parameters:
-
buffer Decode message buffer object abpc Number of bits per character (aligned) ubpc Number of bits per character (unaligned) charSet Object representing permitted alphabet constraint character set (optional) lower Effective size constraint lower bound upper Effective size constraint upper bound
virtual internal void Decode | ( | Asn1PerDecodeBuffer | buffer, | |
int | abpc, | |||
int | ubpc, | |||
Asn1CharSet | charSet | |||
) | [protected, virtual] |
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 public mValue
member variable.
- Parameters:
-
buffer Decode message buffer object abpc Number of bits per character (aligned) ubpc Number of bits per character (unaligned) charSet Object representing the permitted alphabet constraint character set (optional)
virtual internal void Decode | ( | Asn1BerDecodeBuffer | buffer, | |
bool | explicitTagging, | |||
int | implicitLength, | |||
Asn1Tag | tag | |||
) | [protected, virtual] |
This method decodes an ASN.1 character string value including the UNIVERSAL tag value and length if explicit tagging is specified. It is a protected method that can only be accessed by objects subclassed from this type.
- Parameters:
-
buffer Decode message buffer object explicitTagging Flag indicating element is explicitly tagged implicitLength Length of contents if implicit tag Universal tag to apply
Reimplemented in Asn1Time.
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:
-
buffer String containing data to be decoded attrs Attributes string from element tag
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:
-
buffer String containing data to be decoded attrs Attributes string from element tag
Reimplemented in Asn1Time.
virtual 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:
-
buffer Encode message buffer object elemName XML element name used to wrap string nsPrefix XML element namespace value
Reimplemented in Asn1Real10, and Asn1Time.
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:
-
buffer Encode message buffer object elemName XML element name used to wrap string
Reimplemented from Asn1Type.
Reimplemented in Asn1Real10.
virtual internal void Encode | ( | Asn1PerEncodeBuffer | buffer, | |
int | abpc, | |||
int | ubpc, | |||
Asn1CharSet | charSet, | |||
long | lower, | |||
long | upper | |||
) | [protected, virtual] |
This overloaded version of the encode method encodes an ASN.1 character string value in accordance with the packed encoding rules (PER). This version of the method assumes a size constraint is present but no permitted alphabet constraint.
The value to encode is stored in the public mValue
member variable.
- Parameters:
-
buffer Encode message buffer object abpc Number of bits per character (aligned) ubpc Number of bits per character (unaligned) charSet Object representing the permitted alphabet constraint character set (optional) lower Effective size constraint lower bound upper Effective size constraint upper bound
virtual internal void Encode | ( | Asn1PerEncodeBuffer | buffer, | |
int | abpc, | |||
int | ubpc, | |||
Asn1CharSet | charSet | |||
) | [protected, virtual] |
This method encodes an ASN.1 character string value in accordance with the packed encoding rules (PER). This version of the method assumes no permitted alphabet or size constraints.
The value to encode is stored in the public mValue
member variable.
- Parameters:
-
buffer Encode message buffer object abpc Number of bits per character (aligned) ubpc Number of bits per character (unaligned) charSet Object representing the permitted alphabet constraint character set (optional)
virtual internal int Encode | ( | Asn1BerEncodeBuffer | buffer, | |
bool | explicitTagging, | |||
Asn1Tag | tag | |||
) | [protected, virtual] |
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:
-
buffer Encode message buffer object explicitTagging Flag indicating explicit tagging should be done tag Universal tag to apply
- Returns:
- Length in octets of encoded component
Reimplemented in Asn1Time.
override bool Equals | ( | System.Object | value | ) |
This method compares this character string value to the given value for equality.
- Parameters:
-
value The 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
.
Reimplemented in Asn1Time.
bool Equals | ( | System.String | value | ) |
This method compares this character string value to the given value for equality.
- Parameters:
-
value The String value to compare with the current Object.
- Returns:
true
if the specified string is equal to the current Object; otherwise,false
.
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.
Reimplemented in Asn1Time.
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
bool validate | ( | Asn1CharSet | charSet | ) |
This method will attempt to validate a string against its internal character set.
- Returns:
- True or False.
Member Data Documentation
internal System.Text.StringBuilder mStringBuffer [protected] |
The mStringBuffer
member variable is used to do internal operations on a string being encoded or decoded. Users should create it before using if it is null.
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.
Property Documentation
override int Length [get] |
Gets the length of the character string in characters.
Value:
Number of characters.
Reimplemented from Asn1Type.