Asn1BigInteger Class Reference

Inheritance diagram for Asn1BigInteger:
Asn1Type Asn1TypeIF

List of all members.

Public Member Functions

 Asn1BigInteger (System.String value, int radix)
 Asn1BigInteger (System.String value)
 Asn1BigInteger (BigInteger value)
 Asn1BigInteger ()
virtual void Decode (Asn1JsonDecodeBuffer buffer)
override void Decode (Asn1OerDecodeBuffer buffer)
void Decode (Asn1PerDecodeBuffer buffer, BigInteger lower, BigInteger upper)
override void Decode (Asn1PerDecodeBuffer buffer)
override void Decode (Asn1BerDecodeBuffer buffer, bool explicitTagging, int implicitLength)
void DecodeSigned (Asn1OerDecodeBuffer buffer, int octets)
void DecodeSigned (Asn1OerDecodeBuffer buffer)
void DecodeUnsigned (Asn1OerDecodeBuffer buffer, int octets)
void DecodeUnsigned (Asn1OerDecodeBuffer buffer)
BigInteger DecodeValue (Asn1DecodeBuffer buffer, int length)
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)
virtual void Encode (Asn1JsonOutputStream outstream)
override void Encode (Asn1XmlEncoder buffer, System.String elemName, System.String nsPrefix)
override void Encode (Asn1XerEncoder buffer, System.String elemName)
override void Encode (Asn1OerEncodeBuffer buffer)
void Encode (Asn1PerEncodeBuffer buffer, BigInteger lower, BigInteger upper)
override void Encode (Asn1PerEncodeBuffer buffer)
override int Encode (Asn1BerEncodeBuffer buffer, bool explicitTagging)
override void EncodeAttribute (Asn1XmlEncoder buffer, String attrName)
void EncodeSigned (Asn1OerEncodeBuffer buffer)
void EncodeSigned (Asn1OerEncodeBuffer buffer, int octets)
void EncodeUnsigned (Asn1OerEncodeBuffer buffer, int octets)
void EncodeUnsigned (Asn1OerEncodeBuffer buffer)
override bool Equals (System.Object value)
virtual bool Equals (long value)
override int GetHashCode ()
override System.String ToString ()

Public Attributes

BigInteger mValue

Static Public Attributes

static new readonly Asn1Tag _TAG = new Asn1Tag(Asn1Tag.UNIV, Asn1Tag.PRIM, Asn1Type.INTEGER)

Static Protected Member Functions

static internal int EncodeValue (Asn1EncodeBuffer buffer, BigInteger ivalue, bool doCopy)

Detailed Description

This class represents an ASN.1 INTEGER built-in type. In this case, the values can be greater than 64 bits in size. This class is used in generated source code if the <bigInteger> qualifier is specified in a compiler configuration file.


Constructor & Destructor Documentation

Asn1BigInteger (  ) 

The default constructor sets the big integer value object reference to null.

Asn1BigInteger ( BigInteger  value  ) 

This constructor assigns a big integer object.

Parameters:
value BigInteger value
Asn1BigInteger ( System.String  value  ) 

This constructor creates a new big integer object and sets it to the string value passed in. String value may contain the prefix that describes the radix: 0x - hexadecimal, 0o - octal, 0b - binary. The string value without prefix assumes decimal value. The optional sign '-' may be specified at the beginning of the string to specify the negative value.

Parameters:
value String value
Asn1BigInteger ( System.String  value,
int  radix 
)

This constructor creates a new big integer object and sets it to the string value passed in. String value may contain the prefix that describes the radix: 0x - hexadecimal, 0o - octal, 0b - binary. The string value without prefix assumes decimal value. The optional sign '-' may be specified at the beginning of the string to specify the negative value.

Parameters:
value String value
radix Can be 16 for hexadecimal, 8 for octal, 2 for binary or 10 for decimal

Member Function Documentation

virtual void Decode ( Asn1JsonDecodeBuffer  buffer  )  [virtual]

Decode ASN.1 INTEGER from JSON.

override void Decode ( Asn1OerDecodeBuffer  buffer  )  [virtual]

Decode this value as if unconstrained. Subclasses may override this method to decode according to the constraints on the respective ASN.1 type.

Reimplemented from Asn1Type.

void Decode ( Asn1PerDecodeBuffer  buffer,
BigInteger  lower,
BigInteger  upper 
)

This method decodes an ASN.1 integer value using Packed Encoding Rules (PER). The length and contents components of the message are decoded. The decoded result is stored in the public mValue member variable.

Parameters:
buffer PER Decode message buffer object
lower The PER-visible lower bound; null if there is not a lower bound.
upper The PER-visible upper bound; null if there is not an upper bound.
override void Decode ( Asn1PerDecodeBuffer  buffer  )  [virtual]

This method decodes an unconstrained ASN.1 integer value using the Packed Encoding Rules (PER). The length and contents components of the message are decoded. The decoded result is stored in the public mValue member variable.

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 integer value including the UNIVERSAL tag value and length if explicit tagging is specified. This overloaded version uses the Basic Encoding Rules (BER).

Parameters:
buffer Decode message buffer object
explicitTagging Flag indicating element is explicitly tagged
implicitLength Length of contents if implicit

Reimplemented from Asn1Type.

void DecodeSigned ( Asn1OerDecodeBuffer  buffer,
int  octets 
)

Decode a signed integer (2's complement form), of the given length, into this object.

Parameters:
octets The number of octets in which the value was encoded.
void DecodeSigned ( Asn1OerDecodeBuffer  buffer  ) 

Decode a variable-size signed integer, encoded with a length, into this object, following OER.

void DecodeUnsigned ( Asn1OerDecodeBuffer  buffer,
int  octets 
)

Decode an unsigned integer (a binary integer, not 2's complement form), of the given length, into this object.

Parameters:
octets The number of octets in which the value was encoded.
void DecodeUnsigned ( Asn1OerDecodeBuffer  buffer  ) 

Decode a variable-size unsigned integer, encoded with a length, into this object, following OER.

BigInteger DecodeValue ( Asn1DecodeBuffer  buffer,
int  length 
)

This method decodes the contents of an ASN.1 integer value using either the Basic Encoding Rules (BER) or the Packed Encoding Rules (PER).

Parameters:
buffer Decode message buffer object
length Length of encoded contents
Returns:
Decoded integer value
virtual void DecodeXER ( System.String  buffer,
System.String  attrs 
) [virtual]

This method decodes an ASN.1 integer 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 integer 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 unconstrained ASN.1 integer value using the Packed Encoding Rules (PER). The length and contents components of the message are encoded.

Also throws any exception thrown by the underlying 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 integer 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.

virtual void Encode ( Asn1JsonOutputStream  outstream  )  [virtual]

Encode this ASN.1 INTEGER value to JSON

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

This method encodes an ASN.1 integer value using the XML Encoding as specified in the XML schema standard.

Parameters:
buffer Encode message buffer object
elemName Element name
nsPrefix Element namespace prefix name

Reimplemented from Asn1Type.

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

This method encodes an ASN.1 integer value using the XML encoding rules (XER).

Parameters:
buffer Encode message buffer object
elemName Element name

Reimplemented from Asn1Type.

override void Encode ( Asn1OerEncodeBuffer  buffer  )  [virtual]

Encode this value as if unconstrained. Subclasses may override this method to encode it according to the constraints on the respective ASN.1 type.

Reimplemented from Asn1Type.

void Encode ( Asn1PerEncodeBuffer  buffer,
BigInteger  lower,
BigInteger  upper 
)

This method encodes an ASN.1 integer value using Packed Encoding Rules (PER).

The length and contents components of the message are encoded.

Parameters:
buffer PER Encode message buffer object
lower The PER-visible lower bound; null if there is not a lower bound.
upper The PER-visible upper bound; null if there is not an upper bound.
Returns:
Length of component or negative status value
override void Encode ( Asn1PerEncodeBuffer  buffer  )  [virtual]

This method encodes an unconstrained ASN.1 integer value using the Packed Encoding Rules (PER). The length and contents components of the message are encoded.

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 integer value including the UNIVERSAL tag value and length if explicit tagging is specified. This overloaded version uses the Basic Encoding Rules (BER).

Parameters:
buffer Encode message buffer object
explicitTagging Flag indicating explicit tagging should be done
Returns:
Length of component or negative status value

Reimplemented from Asn1Type.

override void EncodeAttribute ( Asn1XmlEncoder  buffer,
String  attrName 
)

This method encodes an ASN.1 integer value using the XML Encoding as specified in the XML schema standard.

Parameters:
buffer Encode message buffer object
elemName Element name
attribute Attribute name
void EncodeSigned ( Asn1OerEncodeBuffer  buffer  ) 

Encode this value as a variable-size signed integer, with length, according to OER.

void EncodeSigned ( Asn1OerEncodeBuffer  buffer,
int  octets 
)

Encode integer value as a signed value (2's complement) in the given number of octets.

The value must fit in the given number of octets.

Parameters:
buffer The buffer.
octets The number of octets to encode in; 0 < octets <= 8
void EncodeUnsigned ( Asn1OerEncodeBuffer  buffer,
int  octets 
)

Encode integer value as an unsigned value (binary integer) in the given number of octets.

The value must be non-negative and fit in the given number of octets.

Parameters:
buffer The buffer.
octets The number of octets to encode in; 0 < octets <= 8.
void EncodeUnsigned ( Asn1OerEncodeBuffer  buffer  ) 

Encode this value as a variable-size unsigned integer, with length, according to OER.

static internal int EncodeValue ( Asn1EncodeBuffer  buffer,
BigInteger  ivalue,
bool  doCopy 
) [static, protected]

This method encodes an ASN.1 integer value's contents in accordance with either the ASN.1 Basic Encoding Rules (BER) or Packed Encoding Rules (PER).

Parameters:
buffer Encode message buffer object
ivalue Integer value to encode
doCopy Encode the copy of the value
Returns:
Length of encoded component
override bool Equals ( System.Object  value  ) 

This method compares this value to the given Asn1BigInteger value for equality.

Parameters:
value The Object to compare with the current Object. Object should be instance of Asn1BigInteger.
Returns:
true if the specified Object is equal to the current Object; otherwise, false.
virtual bool Equals ( long  value  )  [virtual]

This method compares this value to the given integer value for equality.

Parameters:
value The long value to compare with the current Object.
Returns:
true if the specified long 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.
override System.String ToString (  ) 

This method will return a string representation of the integer 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 2).

Reimplemented from Asn1Type.

The magnitude of this Asn1BigInteger, in big-endian order: the zeroth element of this array is the most-significant int of the magnitude. The magnitude must be "minimal" in that the most-significant int (mValue[0]) must be non-zero. This is necessary to ensure that there is exactly one representation for each Asn1BigInteger value. Note that this implies that the Asn1BigInteger zero has a zero-length mValue array.