ASN1C C# Runtime Library
7.8
|
Public Member Functions | |
Asn1PerEncodeBuffer (bool aligned) | |
Asn1PerEncodeBuffer (bool aligned, int sizeIncrement) | |
override void | BinDump (System.IO.StreamWriter outs, System.String varName) |
override void | ByteAlign () |
virtual void | EncodeBit (bool value, System.String ident) |
override void | EncodeBit (bool value) |
virtual void | EncodeBits (byte[] value, int offset, int nbits, System.String ident) |
virtual void | EncodeBits (byte[] value, int offset, int bitOffset, int nbits, System.String ident) |
override void | EncodeBits (byte[] value, int offset, int bitOffset, int nbits) |
override void | EncodeBits (byte[] value, int offset, int nbits) |
virtual void | EncodeCharString (System.String value, int nchars, int offset, int abpc, int ubpc, Asn1CharSet charSet) |
virtual void | EncodeConsWholeNumber (long adjustedValue, long rangeValue, System.String ident) |
virtual void | EncodeConsWholeNumber (long adjustedValue, long rangeValue) |
virtual void | EncodeInt (long value, int nbits, System.String ident) |
virtual void | EncodeInt (long value, int nbits) |
virtual void | EncodeInt (long value, bool encodeLen, bool signExtend, System.String ident) |
virtual void | EncodeInt (long value, bool encodeLen, bool signExtend) |
virtual long | EncodeLength (long value) |
virtual void | EncodeLength (long value, long lower, long upper) |
virtual void | EncodeLengthEOM (long value) |
virtual void | EncodeOctetString (byte[] value, int offset, int nbytes) |
virtual void | EncodeOIDLengthAndValue (int[] value) |
virtual void | EncodeOpenType (byte[] value, int offset, int nbytes) |
virtual void | EncodeOpenType (Asn1PerEncodeBuffer buffer, System.String elemName) |
virtual void | EncodeRelOIDLengthAndValue (int[] value) |
virtual void | EncodeSmallLength (int value) |
virtual void | EncodeSmallNonNegWholeNumber (int value) |
virtual long | EncodeUnconsLength (long value) |
override void | HexDump () |
virtual bool | IsAligned () |
override void | Reset () |
virtual void | SetAligned (bool value) |
void | SetSizeConstraint (long lower, long upper) |
void | SetSizeConstraintExt (long lower, long upper, long extLower, long extUpper) |
Public Member Functions inherited from Asn1PerMessageBuffer | |
System.IO.Stream | GetInputStream () |
Public Member Functions inherited from Asn1PerEncoder | |
void | EncodeBits (byte val, int nbits) |
Properties | |
virtual Asn1PerTraceHandler | TraceHandler [get] |
Properties inherited from Asn1PerMessageBuffer | |
int | MsgBitCnt [get] |
Asn1PerTraceHandler | TraceHandler [get] |
This class handles the encoding of ASN.1 messages as specified in the Packed Encoding Rules (PER) ITU-T X.691 standard.
Asn1PerEncodeBuffer | ( | bool | aligned | ) |
This constructor creates a PER encode buffer object with the default size increment. Whenever the buffer becomes full, the buffer will be expanded by the sizeIncrement size.
aligned | true for PER aligned or false for PER unaligned encoding. |
Asn1PerEncodeBuffer | ( | bool | aligned, |
int | sizeIncrement | ||
) |
This constructor creates a PER encode buffer object with the given size increment. Whenever the buffer becomes full, the buffer will be expanded by the sizeIncrement size. This size should be large enough to prevent resizing in normal operation.
aligned | true for PER aligned or false for PER unaligned encoding. |
sizeIncrement | The initial size in bytes of an encode buffer. If the buffer becomes full, it will be expanded by the amount. |
|
virtual |
This method dumps the encoded message in a human-readable format showing a bit trace of all fields to the given print output stream.
outs | StreamWriter object to which output should be written |
varName | Name of top-level message object variable |
Implements Asn1EncodeBuffer.
override void ByteAlign | ( | ) |
This method byte-aligns the buffer if the buffer is set to be aligned.
Implements Asn1PerMessageBuffer.
Referenced by Asn1BitString.BaseEncode(), Asn1PerOutputStream.ByteAlign(), Asn1Real10.Encode(), Asn1UTF8String.Encode(), Asn1OctetString.Encode(), Asn1BigInteger.Encode(), Asn1UniversalString.Encode(), and Asn1CharString.validate().
|
virtual |
This method encodes a single bit value.
value | Boolean value of bit to be encoded. |
ident | Bit field identifier name for tracing. |
Implements Asn1PerEncoder.
Referenced by Asn1Boolean.Encode(), Asn1PerOutputStream.EncodeBit(), Asn1OpenExt.EncodeExtBits(), and Asn1Boolean.ToString().
override void EncodeBit | ( | bool | value | ) |
This method encodes a single bit value. The ident
argument which is used for tracing is defaulted to 'value'. Equivalent to EncodeBit(value, "value");
value | Boolean value of bit to be encoded. |
Implements Asn1PerEncoder.
|
virtual |
This method encodes bit values from an array of octets.
value | Octet array containing bits to be encoded |
offset | Starting byte offset in value |
nbits | Number of bits to encode |
ident | Bit field identifier name for tracing. |
Implements Asn1PerEncoder.
Referenced by Asn1BitString.BaseEncode(), Asn1PerOutputStream.Close(), Asn1UTF8String.Encode(), Asn1BigInteger.Encode(), Asn1OctetString.Encode(), Asn1Real.Encode(), and Asn1PerOutputStream.EncodeBits().
|
virtual |
This method encodes bit values from an array of octets.
value | Octet array containing bits to be encoded |
offset | Starting byte offset in value |
bitOffset | Starting bit offset in first byte. For example, passing 0 would begin encoding with the most significant bit, while passing 7 would begin encoding with the least significant bit. |
nbits | Number of bits to encode |
ident | Bit field identifier name for tracing. |
override void EncodeBits | ( | byte [] | value, |
int | offset, | ||
int | bitOffset, | ||
int | nbits | ||
) |
This method encodes bit values from an array of octets.
This overrides the parent class method in order to default the name for tracing to "value". Equivalent to: encodeBits(value, offset, bitOffset, nbits, "value");
override void EncodeBits | ( | byte [] | value, |
int | offset, | ||
int | nbits | ||
) |
This method encodes bit values from an array of octets. The ident
argument which is used for tracing is defaulted to 'value'.
value | Octet array containing bits to be encoded |
offset | Starting byte offset in value |
nbits | Number of bits to encode |
Implements Asn1PerEncoder.
|
virtual |
This method encodes the contents of a known-multiplier character string type. This version assumes a permitted alphabet constraint was specified.
value | String containing characters to encode |
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) |
Implements Asn1PerEncoder.
References Asn1CharSet.GetCharIndex(), Asn1CharSet.GetNumBitsPerChar(), Asn1CharSet.MaxValue, and Diag.Prtln().
Referenced by Asn1PerOutputStream.EncodeCharString(), and Asn1CharString.validate().
|
virtual |
This method implements the rules to encode a constrained whole number as specified in section 10.5 of the X.691 standard.
adjustedValue | Adjusted value to be encoded = value - lower range endpoint value |
rangeValue | lower - upper + 1 |
ident | Tracing identifier |
Implements Asn1PerEncoder.
References Asn1Integer.GetBitCount(), Asn1Integer.GetUnsignedBitCount(), and Diag.Prtln().
Referenced by Asn1Enumerated.Encode(), Asn1X694OrderElement.Encode(), Asn1BigInteger.Encode(), and Asn1PerOutputStream.EncodeConsWholeNumber().
|
virtual |
This method implements the rules to encode a constrained whole number as specified in section 10.5 of the X.691 standard. The ident
argument which is used for tracing is defaulted to 'value'.
adjustedValue | Adjusted value to be encoded = value - lower range endpoint value |
rangeValue | lower - upper + 1 |
Implements Asn1PerEncoder.
|
virtual |
This method encodes bit values from an integer value. The least significant bits from the integer are encoded.
value | Integer containing bits to be encoded |
nbits | Number of bits to encode |
ident | Tracing identifier |
Implements Asn1PerEncoder.
References Diag.Prtln(), and Asn1Util.URShift().
Referenced by Asn1Integer.Encode(), Asn1UniversalString.Encode(), Asn1Real.Encode(), Asn1PerOutputStream.EncodeInt(), and Asn1Integer.ToString().
|
virtual |
This method encodes bit values from an integer value. The least significant bits from the integer are encoded. The ident
argument which is used for tracing is defaulted to 'value'.
value | Integer containing bits to be encoded |
nbits | Number of bits to encode |
Implements Asn1PerEncoder.
|
virtual |
This method implements the rules to encode either a non-negative binary integer as specified in section 10.3 or a two's complement binary integer as specified in section 10.4 of the X.691 standard.
value | Integer value to be encoded |
encodeLen | Flag indicating length determinant should be encoded before encoding integer value. |
signExtend | Flag indicating if sign extension should be performed. |
ident | Tracing identifier |
Implements Asn1PerEncoder.
References Asn1Integer.GetBitCount(), Asn1Integer.GetUnsignedBitCount(), and Diag.Prtln().
|
virtual |
This method implements the rules to encode either a non-negative binary integer as specified in section 10.3 or a two's complement binary integer as specified in section 10.4 of the X.691 standard. The ident
argument which is used for tracing is defaulted to 'value'.
value | Integer value to be encoded |
encodeLen | Flag indicating length determinant should be encoded before encoding integer value. |
signExtend | Flag indicating if sign extension should be performed. |
Implements Asn1PerEncoder.
|
virtual |
This method encodes either a constrained or unconstrained length depending on whether a size constraint object is set in this object.
value | Length value to be encoded |
Implements Asn1PerEncoder.
References Asn1SizeConstraint.Extensible, Asn1SizeConstraint.RootLower, and Asn1SizeConstraint.RootUpper.
Referenced by Asn1BitString.BaseEncode(), Asn1StringRelativeOID.Encode(), Asn1Real10.Encode(), Asn1StringOID.Encode(), Asn1UTF8String.Encode(), Asn1Integer.Encode(), Asn1BigInteger.Encode(), Asn1OctetString.Encode(), Asn1UniversalString.Encode(), Asn1Real.Encode(), Asn1PerOutputStream.EncodeLength(), and Asn1CharString.validate().
|
virtual |
This method encodes a constrained length determinant value.
value | Length value to be encoded |
lower | Lower bound (inclusive) of length value range |
upper | Upper bound (inclusive) of length value range |
Implements Asn1PerEncoder.
|
virtual |
This method checks to see if a zero byte needs to be added after a fragmented length has been encoded. It will add it to the byte stream if necessary.
value | Original length value that was encoded. |
Implements Asn1PerEncoder.
Referenced by Asn1BitString.BaseEncode(), Asn1UTF8String.Encode(), Asn1UniversalString.Encode(), Asn1PerOutputStream.EncodeLengthEOM(), and Asn1CharString.validate().
|
virtual |
This method encodes the given array of bytes as an unconstrained octet string value.
value | Byte array containing data to encode. This is assumed to contain a previously encoded PER component. |
offset | Starting offset in byte array value |
nbytes | Number of bytes to encode |
Implements Asn1PerEncoder.
Referenced by Asn1OctetString.Encode(), Asn1PerOutputStream.EncodeOctetString(), and Asn1OctetString.ToString().
|
virtual |
This method encodes the length and contents of an object identifier value.
value | Integer array containing arcs to encode |
Implements Asn1PerEncoder.
References Diag.Prtln().
Referenced by Asn1ObjectIdentifier.Encode(), and Asn1PerOutputStream.EncodeOIDLengthAndValue().
|
virtual |
This method encodes the given array of bytes as an open type.
value | Byte array containing data to encode. This is assumed to contain a previously encoded PER component. |
offset | Starting offset in byte array value |
nbytes | Number of bytes to encode |
Implements Asn1PerEncoder.
Referenced by Asn1OpenType.Encode(), and Asn1PerOutputStream.EncodeOpenType().
|
virtual |
This overloaded version of encodeOpenType will encode the componet in the given PER encode buffer into this PER encode buffer.
buffer | PER encode buffer containing encoded message component. |
elemName | Name of element being encoded. |
|
virtual |
This method encodes the length and contents of a relative object identifier value.
value | Integer array containing arcs to encode |
Implements Asn1PerEncoder.
References Diag.Prtln().
Referenced by Asn1RelativeOID.Encode(), and Asn1PerOutputStream.EncodeRelOIDLengthAndValue().
|
virtual |
This method implements the rules to encode a normally small length as specified in section 11.9 of the X.691 standard.
value | Value to be encoded |
Implements Asn1PerEncoder.
References Diag.Prtln().
Referenced by Asn1PerOutputStream.EncodeSmallLength().
|
virtual |
This method implements the rules to encode a small non-negative whole number as specified in section 10.6 of the X.691 standard.
value | Value to be encoded |
Implements Asn1PerEncoder.
References Diag.Prtln().
Referenced by Asn1ChoiceExt.Encode(), and Asn1PerOutputStream.EncodeSmallNonNegWholeNumber().
|
virtual |
This method encodes a general (unconstrained) length determinant value as described in section 10.9 or the X.691 standard.
value | Length value to be encoded |
|
virtual |
This method dumps the encoded message in hex/ascii format to the standard output stream.
Reimplemented from Asn1EncodeBuffer.
|
virtual |
This method is used to test if PER aligned encoding has been specified.
true
for PER aligned encoding or false
for unaligned encoding. Implements Asn1PerMessageBuffer.
Referenced by Asn1BigInteger.Encode(), Asn1UniversalString.Encode(), and Asn1CharString.validate().
|
virtual |
This method resets the buffer object so that it can be reused to encode another PER message. Any previously encoded data is lost.
Implements Asn1EncodeBuffer.
Referenced by Asn1PerOutputStream.Close().
|
virtual |
This method is used to turn PER aligned encoding on or off
value | true for PER aligned encoding or false for unaligned encoding. |
void SetSizeConstraint | ( | long | lower, |
long | upper | ||
) |
This method is used to set a size constraint within the buffer object. The constraint will only be set if an existing constraint is not already in place (i.e. if the existing reference is not null). This is used for length decoding of SEQUENCE OF objects to pass constraints applied to referenced objects to the base object.
void SetSizeConstraintExt | ( | long | lower, |
long | upper, | ||
long | extLower, | ||
long | extUpper | ||
) |
This method is used to set an extensible size constraint in the buffer object. The constraint will only be set if an existing constraint is not already in place (i.e. if the existing reference is not null). This is used for length encoding of SEQUENCE OF objects to pass constraints applied to referenced objects to the base object.
References Asn1Util.URShift().
|
get |
Gets a reference to the internal trace handler object used to trace the bit fields within a PER message.
Value:
Asn1PerTraceHandler object
Referenced by Asn1StringRelativeOID.Encode(), Asn1StringOID.Encode(), Asn1Integer.Encode(), Asn1BigInteger.Encode(), and Asn1Real.Encode().