Asn1Boolean Class Reference
Public Member Functions | |
Asn1Boolean (bool value_) | |
Asn1Boolean () | |
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) |
override void | Encode (Asn1PerOutputStream outs) |
override void | Encode (Asn1BerOutputStream outs, bool explicitTagging) |
override void | Encode (Asn1XmlEncoder buffer, System.String elemName, System.String nsPrefix) |
virtual void | Encode (Asn1XerEncodeBuffer buffer) |
override void | Encode (Asn1XerEncoder buffer, System.String elemName) |
override void | Encode (Asn1PerEncodeBuffer buffer) |
override int | Encode (Asn1BerEncodeBuffer buffer, bool explicitTagging) |
override void | EncodeAttribute (Asn1XmlEncoder buffer, System.String attrName) |
override bool | Equals (System.Object value) |
virtual bool | Equals (bool value) |
override int | GetHashCode () |
override System.String | ToString () |
Static Public Member Functions | |
static void | setTrueEncodedByte (byte b) |
Public Attributes | |
bool | mValue |
Static Public Attributes | |
static new readonly Asn1Tag | _TAG |
static readonly Asn1Boolean | FALSE_VALUE = new Asn1Boolean(false) |
static readonly Asn1Boolean | TRUE_VALUE = new Asn1Boolean(true) |
Detailed Description
This class represents the ASN.1 BOOLEAN built-in type.
Constructor & Destructor Documentation
Asn1Boolean | ( | ) |
The default constructor sets the boolean value to false.
Asn1Boolean | ( | bool | value_ | ) |
This constructor creates a boolean object from a boolean value.
- Parameters:
-
value_ Boolean value
Member Function Documentation
override void Decode | ( | Asn1PerDecodeBuffer | buffer | ) | [virtual] |
- This method decodes an ASN.1 boolean value using
- the Packed Encoding Rules (PER).
- The decoded result is stored in the public member mValue
- in this object.
- Parameters:
-
buffer PER Decode message buffer object
Reimplemented from Asn1Type.
override void Decode | ( | Asn1BerDecodeBuffer | buffer, | |
bool | explicitTagging, | |||
int | implicitLength | |||
) | [virtual] |
- This method decodes an ASN.1 boolean value including the UNIVERSAL
- tag value and length if explicit tagging is specified. This overloaded version uses the Basic Encoding Rules (BER) or the Distinguished Encoding Rules (DER).
- The decoded result is stored in the public member mValue
- in this object.
- Parameters:
-
buffer Decode message buffer object explicitTagging Flag indicating element is explicitly tagged implicitLength Length of contents if implicit
- Returns:
- Decoded boolean value
Reimplemented from Asn1Type.
virtual void DecodeXER | ( | System.String | buffer, | |
System.String | attrs | |||
) | [virtual] |
This method decodes an ASN.1 boolean 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 boolean value using the XML Schema encoding rules(asn2xsd).
- Parameters:
-
buffer String containing data to be decoded attrs Attributes string from element tag
override void Encode | ( | Asn1PerOutputStream | outs | ) | [virtual] |
This method encodes an ASN.1 boolean value using the Packed Encoding Rules (PER).
Also throws any exception thrown by the underlying Asn1PerOutputStream.
- Parameters:
-
outs PER Encode message 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 boolean 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 the underlying System.IO.Stream object.
- Parameters:
-
outs BER Output Stream object explicitTagging Flag indicating explicit tagging should be done
- Exceptions:
-
Asn1Exception Thrown, if operation is failed.
Reimplemented from Asn1Type.
override void Encode | ( | Asn1XmlEncoder | buffer, | |
System.String | elemName, | |||
System.String | nsPrefix | |||
) | [virtual] |
This method encodes an ASN.1 boolean value using the XML Encoding as specified in the XML schema standard(asn2xsd).
- Parameters:
-
buffer Encode message buffer object elemName Element name nsPrefix Element namespace prefix value
Reimplemented from Asn1Type.
virtual void Encode | ( | Asn1XerEncodeBuffer | buffer | ) | [virtual] |
This method encodes an ASN.1 boolean value using the XML encoding rules (XER). This method does not add start and end tags (<tag> and </tag>), only value is encoded (<true/> or <false/>).
- Parameters:
-
buffer Encode message buffer object
override void Encode | ( | Asn1XerEncoder | buffer, | |
System.String | elemName | |||
) | [virtual] |
This method encodes an ASN.1 boolean value using the XML encoding rules (XER).
- Parameters:
-
buffer Encode message buffer object elemName Element name
Reimplemented from Asn1Type.
override void Encode | ( | Asn1PerEncodeBuffer | buffer | ) | [virtual] |
This method encodes an ASN.1 boolean value using the Packed Encoding Rules (PER).
- Parameters:
-
buffer PER Encode message buffer object
- Returns:
- Length of component or negative status value
Reimplemented from Asn1Type.
override int Encode | ( | Asn1BerEncodeBuffer | buffer, | |
bool | explicitTagging | |||
) | [virtual] |
This method encodes an ASN.1 boolean value including the UNIVERSAL tag value and length if explicit tagging is specified. This overloaded version uses the Basic Encoding Rules (BER) or the Distinguished Encoding Rules (DER).
- Parameters:
-
buffer Encode message buffer object explicitTagging Flag indicating explicit tagging should be done
- Returns:
- Length (in octets) of encoded component
Reimplemented from Asn1Type.
override void EncodeAttribute | ( | Asn1XmlEncoder | buffer, | |
System.String | attrName | |||
) | [virtual] |
This method encodes an ASN.1 boolean value using the XML Encoding as specified in the W3C XML schema standard(asn2xsd).
- Parameters:
-
buffer Encode message buffer object attrName Element name
Reimplemented from Asn1Type.
override bool Equals | ( | System.Object | value | ) |
This method compares this boolean value to the given value for equality.
- Parameters:
-
value The Object to compare with the current Object. Object should be instance of Asn1Boolean.
- Returns:
true
if the specified Object is equal to the current Object; otherwise,false
.
virtual bool Equals | ( | bool | value | ) | [virtual] |
This method compares this boolean value to the given value for equality.
- Parameters:
-
value The bool value to compare with the current Object.
- Returns:
true
if the specified bool value 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.
static void setTrueEncodedByte | ( | byte | b | ) | [static] |
This method sets the byte value that represents the boolean value TRUE. If a zero byte (0x00) is passed, the value is transparently set to 0xFF, the valid representation for BER, CER, and DER.
- Parameters:
-
b The byte value to set.
override System.String ToString | ( | ) |
This method will return a string representation of the boolean value. The format is the ASN.1 value format for this type.
- Returns:
- Stringified representation of the value
Member Data Documentation
The _TAG
constant describes the universal tag for this data type (UNIVERSAL 1).
Reimplemented from Asn1Type.
readonly Asn1Boolean FALSE_VALUE = new Asn1Boolean(false) [static] |
The FALSE_VALUE
constant represents a boolean FALSE value.
bool mValue |
This public member variable is where the boolean value is stored. This is the value that is encoded when one of the encode methods is called. It is also where the decoded result is stored when a Decode method is called.
readonly Asn1Boolean TRUE_VALUE = new Asn1Boolean(true) [static] |
The TRUE_VALUE
constant represents a boolean TRUE value.