Asn1UniversalString Class Reference
Public Member Functions | |
Asn1UniversalString (System.String value) | |
Asn1UniversalString (int[] value) | |
Asn1UniversalString () | |
virtual void | Decode (Asn1PerDecodeBuffer buffer, Asn1CharSet charSet, long lower, long upper) |
virtual void | Decode (Asn1PerDecodeBuffer buffer, Asn1CharSet charSet) |
override void | Decode (Asn1PerDecodeBuffer buffer) |
override void | Decode (Asn1BerDecodeBuffer buffer, bool explicitTagging, int implicitLength) |
virtual void | DecodeXER (System.String buffer, System.String attrs) |
override void | DecodeXML (System.String buffer, System.String attrs) |
virtual void | Encode (Asn1PerOutputStream outs, Asn1CharSet charSet, long lower, long upper) |
virtual void | Encode (Asn1PerOutputStream outs, Asn1CharSet charSet) |
override void | Encode (Asn1PerOutputStream outs) |
override void | Encode (Asn1BerOutputStream outs, bool explicitTagging) |
virtual void | Encode (Asn1XmlEncoder buffer, System.String elemName, System.String nsPrefix) |
override void | Encode (Asn1XerEncoder buffer, System.String elemName) |
virtual void | Encode (Asn1PerEncodeBuffer buffer, Asn1CharSet charSet, long lower, long upper) |
virtual void | Encode (Asn1PerEncodeBuffer buffer, Asn1CharSet charSet) |
override void | Encode (Asn1PerEncodeBuffer buffer) |
override int | Encode (Asn1BerEncodeBuffer buffer, bool explicitTagging) |
virtual void | EncodeData (Asn1XmlXerEncoder buffer) |
override bool | Equals (System.Object value) |
override int | GetHashCode () |
override System.String | ToString () |
bool | validate (Asn1CharSet charSet) |
Public Attributes | |
const int | BITSPERCHAR = 32 |
int[] | mValue |
Static Public Attributes | |
static new readonly Asn1Tag | _TAG |
Protected Member Functions | |
virtual internal void | Decode (Asn1PerDecodeBuffer buffer, int abpc, int ubpc, Asn1CharSet charSet, long lower, long upper) |
virtual internal void | Decode (Asn1PerDecodeBuffer buffer, int nchars, int abpc, int ubpc, Asn1CharSet charSet, int startIdx) |
virtual internal void | Decode (Asn1PerDecodeBuffer buffer, int abpc, int ubpc, Asn1CharSet charSet) |
virtual internal void | Encode (Asn1PerOutputStream outs, int abpc, int ubpc, Asn1CharSet charSet, long lower, long upper) |
virtual internal void | Encode (Asn1PerOutputStream outs, int abpc, int ubpc, Asn1CharSet charSet) |
virtual internal void | Encode (Asn1PerOutputStream outs, int nchars, int offset, int abpc, int ubpc, Asn1CharSet charSet) |
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 void | Encode (Asn1PerEncodeBuffer buffer, int nchars, int offset, int abpc, int ubpc, Asn1CharSet charSet) |
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 Universal string value.
Constructor & Destructor Documentation
This constructor creates an empty string that can be used in a Decode method call to receive a string value.
Asn1UniversalString | ( | int[] | value | ) |
This constructor initializes the universal string from the given an array of 32-bit integer value.
- Parameters:
-
value universal string value as array of 32-bit int
Asn1UniversalString | ( | System.String | value | ) |
This constructor converts a standard C# string value into a universal string.
- Parameters:
-
value universal string value as 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 UniversalString 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 | nchars, | |||
int | abpc, | |||
int | ubpc, | |||
Asn1CharSet | charSet, | |||
int | startIdx | |||
) | [protected, virtual] |
This method decodes the contents of a UniversalString. This version of the method assumes a permitted alphabet constraint is in place.
- Parameters:
-
buffer Decode message buffer object nchars Number of characters abpc Number of bits per character (aligned) ubpc Number of bits per character (unaligned) charSet Object representing the permitted alphabet constraint character set (optional) startIdx Start index to fill in value array
virtual internal void Decode | ( | Asn1PerDecodeBuffer | buffer, | |
int | abpc, | |||
int | ubpc, | |||
Asn1CharSet | charSet | |||
) | [protected, virtual] |
This method decodes an ASN.1 UniversalString 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 void Decode | ( | Asn1PerDecodeBuffer | buffer, | |
Asn1CharSet | charSet, | |||
long | lower, | |||
long | upper | |||
) | [virtual] |
This overloaded version of the Decode method decodes an ASN.1 UniversalString 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 charSet Object representing permitted alphabet constraint character set (optional) lower Effective size constraint lower bound upper Effective size constraint upper bound
virtual void Decode | ( | Asn1PerDecodeBuffer | buffer, | |
Asn1CharSet | charSet | |||
) | [virtual] |
This method decodes an ASN.1 UniversalString value in accordance with the packed encoding rules (PER). This version of the method assumes no size constraints but allows a permitted alphabet character set to be specified. Decoded characters are assigned as-is to the output string. The decoded result is stored in the public mValue
member variable.
- Parameters:
-
buffer Decode message buffer object charSet Object representing permitted alphabet constraint character set (optional)
override void Decode | ( | Asn1PerDecodeBuffer | buffer | ) | [virtual] |
This method decodes an ASN.1 UniversalString value in accordance with the packed encoding rules (PER). This version of the method assumes no permitted alphabet or size constraints. Decoded characters are assigned as-is to the output string. The decoded result is stored in the public mValue
member variable.
- Parameters:
-
buffer Decode message buffer object
Reimplemented from Asn1Type.
override void Decode | ( | Asn1BerDecodeBuffer | buffer, | |
bool | explicitTagging, | |||
int | implicitLength | |||
) | [virtual] |
This method decodes an ASN.1 universal string value including the UNIVERSAL tag value and length if explicit tagging is specified.
- Parameters:
-
buffer Decode message buffer object explicitTagging Flag indicating element is explicitly tagged implicitLength Length of contents if implicit
Reimplemented from Asn1Type.
virtual void DecodeXER | ( | System.String | buffer, | |
System.String | attrs | |||
) | [virtual] |
This method decodes an ASN.1 Universal String value 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 an ASN.1 Universal String value using the XML schema encoding rules(asn2xsd).
- Parameters:
-
buffer String containing data to be decoded attrs Attributes string from element tag
virtual internal void Encode | ( | Asn1PerOutputStream | outs, | |
int | abpc, | |||
int | ubpc, | |||
Asn1CharSet | charSet, | |||
long | lower, | |||
long | upper | |||
) | [protected, virtual] |
This overloaded version of the encode method encodes an ASN.1 UniversalString 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.
Also throws any exception thrown by the Asn1PerOutputStream.
- Parameters:
-
outs PER Output Stream 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
- Exceptions:
-
Asn1Exception Thrown, if operation is failed.
virtual internal void Encode | ( | Asn1PerOutputStream | outs, | |
int | abpc, | |||
int | ubpc, | |||
Asn1CharSet | charSet | |||
) | [protected, virtual] |
This method encodes an ASN.1 UniversalString 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.
Also throws any exception thrown by the Asn1PerOutputStream.
- Parameters:
-
outs PER Output Stream 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)
- Exceptions:
-
Asn1Exception Thrown, if operation is failed.
virtual internal void Encode | ( | Asn1PerOutputStream | outs, | |
int | nchars, | |||
int | offset, | |||
int | abpc, | |||
int | ubpc, | |||
Asn1CharSet | charSet | |||
) | [protected, virtual] |
This method encodes the contents of a UniversalString type. This version assumes a permitted alphabet constraint was specified.
Also throws any exception thrown by the Asn1PerOutputStream.
- Parameters:
-
outs PER Output Stream object nchars Number of characters from string to encode offset Offset to first char in string to encode abpc Number of bits per character (aligned) ubpc Number of bits per character (unaligned) charSet Object representing permitted alphabet constraint character set (optional)
- Exceptions:
-
Asn1Exception Thrown, if operation is failed.
virtual void Encode | ( | Asn1PerOutputStream | outs, | |
Asn1CharSet | charSet, | |||
long | lower, | |||
long | upper | |||
) | [virtual] |
This overloaded version of the encode method encodes an ASN.1 UniversalString value in accordance with the packed encoding rules (PER). This version of the method assumes both a size constraint and permitted alphabet constraint are present.
The value to encode is stored in the public mValue
member variable.
Also throws any exception thrown by the Asn1PerOutputStream.
- Parameters:
-
outs PER Output Stream object charSet Object representing the permitted alphabet constraint character set lower Effective size constraint lower bound upper Effective size constraint upper bound
- Exceptions:
-
Asn1Exception Thrown, if operation is failed.
virtual void Encode | ( | Asn1PerOutputStream | outs, | |
Asn1CharSet | charSet | |||
) | [virtual] |
This method encodes an ASN.1 UniversalString value in accordance with the packed encoding rules (PER). This version of the method assumes no size constraints but does allow a permitted alphabet character set to be specified.
The value to encode is stored in the public mValue
member variable.
Also throws any exception thrown by the Asn1PerOutputStream.
- Parameters:
-
outs PER Output Stream object charSet Object representing permitted alphabet constraint character set (optional)
- Exceptions:
-
Asn1Exception Thrown, if operation is failed.
override void Encode | ( | Asn1PerOutputStream | outs | ) | [virtual] |
This method encodes an ASN.1 UniversalString 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.
Also throws any exception thrown by the Asn1PerOutputStream.
- Parameters:
-
outs PER Output Stream object
- Exceptions:
-
Asn1Exception Thrown, if operation is failed.
Reimplemented from Asn1Type.
override void Encode | ( | Asn1BerOutputStream | outs, | |
bool | explicitTagging | |||
) | [virtual] |
This method encodes and writes to the stream an ASN.1 universal string 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:
-
outs BER Output Stream object explicitTagging Flag indicating explicit tagging should be done
- Exceptions:
-
Asn1Exception Thrown, if operation is failed.
Reimplemented from Asn1Type.
virtual void Encode | ( | Asn1XmlEncoder | buffer, | |
System.String | elemName, | |||
System.String | nsPrefix | |||
) | [virtual] |
This method encodes an ASN.1 Universal String value with element and namespace prefix name tag using the XML Encoding as specified in the XML schema standard(asn2xsd).
- Parameters:
-
buffer Encode message buffer object elemName Element name nsPrefix Element namespace value
override void Encode | ( | Asn1XerEncoder | buffer, | |
System.String | elemName | |||
) | [virtual] |
This method encodes an ASN.1 Universal String value using the XML encoding rules (XER).
- Parameters:
-
buffer Encode message buffer object elemName Element name
Reimplemented from Asn1Type.
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 UniversalString 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 UniversalString 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 void Encode | ( | Asn1PerEncodeBuffer | buffer, | |
int | nchars, | |||
int | offset, | |||
int | abpc, | |||
int | ubpc, | |||
Asn1CharSet | charSet | |||
) | [protected, virtual] |
This method encodes the contents of a UniversalString type. This version assumes a permitted alphabet constraint was specified.
- Parameters:
-
buffer Encode message buffer object nchars Number of characters from string to encode offset Offset to first char in string to encode abpc Number of bits per character (aligned) ubpc Number of bits per character (unaligned) charSet Object representing permitted alphabet constraint character set (optional)
virtual void Encode | ( | Asn1PerEncodeBuffer | buffer, | |
Asn1CharSet | charSet, | |||
long | lower, | |||
long | upper | |||
) | [virtual] |
This overloaded version of the encode method encodes an ASN.1 UniversalString value in accordance with the packed encoding rules (PER). This version of the method assumes both a size constraint and permitted alphabet constraint are present.
The value to encode is stored in the public mValue
member variable.
- Parameters:
-
buffer Encode message buffer object charSet Object representing the permitted alphabet constraint character set lower Effective size constraint lower bound upper Effective size constraint upper bound
virtual void Encode | ( | Asn1PerEncodeBuffer | buffer, | |
Asn1CharSet | charSet | |||
) | [virtual] |
This method encodes an ASN.1 UniversalString value in accordance with the packed encoding rules (PER). This version of the method assumes no size constraints but does allow a permitted alphabet character set to be specified.
The value to encode is stored in the public mValue
member variable.
- Parameters:
-
buffer Encode message buffer object charSet Object representing permitted alphabet constraint character set (optional)
override void Encode | ( | Asn1PerEncodeBuffer | buffer | ) | [virtual] |
This method encodes an ASN.1 UniversalString 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
Reimplemented from Asn1Type.
override int Encode | ( | Asn1BerEncodeBuffer | buffer, | |
bool | explicitTagging | |||
) | [virtual] |
This method encodes an ASN.1 universal string type. The UNIVERSAL tag value and length is also encoded if explicit tagging is specified.
- Parameters:
-
buffer Encode message buffer object explicitTagging Flag indicating explicit tagging should be done
- Returns:
- Length in octets of encoded component
Reimplemented from Asn1Type.
virtual void EncodeData | ( | Asn1XmlXerEncoder | buffer | ) | [virtual] |
This method encodes an ASN.1 Universal String value using the XML Encoding as specified in the XML schema standard(asn2xsd).
- Parameters:
-
buffer Encode message buffer object
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 Asn1UniversalString.
- Returns:
true
if the specified Object 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.
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
The _TAG
constant describes the universal tag for this data type (UNIVERSAL 28).
Reimplemented from Asn1Type.
const int BITSPERCHAR = 32 |
The BITSPERCHAR
constant specifies the number of bits per character for PER (aligned or unaligned).
internal System.Text.StringBuilder mStringBuffer [protected] |
Variable holds the string representation of the value
int [] mValue |
The mValue
public member variable is used to hold the string value to be encoded or the results of a Decode operation. For UniversalString, the characters are stored in an array of 32-bit integer values.
Property Documentation
override int Length [get] |
Gets the length of the character string in characters.
Value:
number of characters.
Reimplemented from Asn1Type.