Asn1PerEncoder Interface Reference
Common interface for PER encoding methods, implemented by Asn1PerEncodeBuffer and Asn1PerOutputStream.
Public Member Functions | |
void | EncodeBit (bool val, System.String ident) |
void | EncodeBit (bool val) |
void | EncodeBits (byte[] val, int offset, int nbits, System.String ident) |
void | EncodeBits (byte[] val, int offset, int nbits) |
void | EncodeBits (byte val, int nbits) |
void | EncodeCharString (System.String val, int nchars, int offset, int abpc, int ubpc, Asn1CharSet charSet) |
void | EncodeConsWholeNumber (long adjustedValue, long rangeValue) |
void | EncodeConsWholeNumber (long adjustedValue, long rangeValue, System.String ident) |
void | EncodeInt (long val, bool encodeLen, bool signExtend) |
void | EncodeInt (long val, bool encodeLen, bool signExtend, System.String ident) |
void | EncodeInt (long val, int nbits) |
void | EncodeInt (long val, int nbits, System.String ident) |
void | EncodeLength (long val, long lower, long upper) |
long | EncodeLength (long val) |
void | EncodeLengthEOM (long val) |
void | EncodeOctetString (byte[] val, int offset, int nbytes) |
void | EncodeOIDLengthAndValue (int[] val) |
void | EncodeOpenType (byte[] val, int offset, int nbytes) |
void | EncodeRelOIDLengthAndValue (int[] val) |
void | EncodeSmallLength (int val) |
void | EncodeSmallNonNegWholeNumber (int val) |
Member Function Documentation
void EncodeBit | ( | bool | val, | |
System.String | ident | |||
) |
This method encodes a single bit value.
- Parameters:
-
val Boolean value of bit to be encoded. ident Bit field identifier name for tracing.
Implemented in Asn1PerEncodeBuffer.
void EncodeBit | ( | bool | val | ) |
This method encodes a single bit value.
- Parameters:
-
val Boolean value of bit to be encoded.
Implemented in Asn1PerEncodeBuffer.
void EncodeBits | ( | byte[] | val, | |
int | offset, | |||
int | nbits, | |||
System.String | ident | |||
) |
This method encodes bit values from an array of octets.
- Parameters:
-
val 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.
Implemented in Asn1PerEncodeBuffer.
void EncodeBits | ( | byte[] | val, | |
int | offset, | |||
int | nbits | |||
) |
This method encodes bit values from an array of octets.
- Parameters:
-
val Octet array containing bits to be encoded offset Starting byte offset in value nbits Number of bits to encode
Implemented in Asn1PerEncodeBuffer.
void EncodeBits | ( | byte | val, | |
int | nbits | |||
) |
This method encodes bit values from an octet.
The most significant bits from the octet are encoded.
- Parameters:
-
val Octet containing bits to be encoded nbits Number of bits to encode
void EncodeCharString | ( | System.String | val, | |
int | nchars, | |||
int | offset, | |||
int | abpc, | |||
int | ubpc, | |||
Asn1CharSet | charSet | |||
) |
This method encodes the contents of a known-multiplier character string type.
This version assumes a permitted alphabet constraint was specified.
- Parameters:
-
val 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)
Implemented in Asn1PerEncodeBuffer.
void EncodeConsWholeNumber | ( | long | adjustedValue, | |
long | rangeValue | |||
) |
This method implements the rules to encode a constrained whole number as specified in section 10.5 of the X.691 standard.
- Parameters:
-
adjustedValue Adjusted value to be encoded = value - lower range endpoint value rangeValue lower - upper + 1
Implemented in Asn1PerEncodeBuffer.
void EncodeConsWholeNumber | ( | long | adjustedValue, | |
long | rangeValue, | |||
System.String | ident | |||
) |
This method implements the rules to encode a constrained whole number as specified in section 10.5 of the X.691 standard.
- Parameters:
-
adjustedValue Adjusted value to be encoded = value - lower range endpoint value rangeValue lower - upper + 1 ident Bit field identifier name for tracing.
Implemented in Asn1PerEncodeBuffer.
void EncodeInt | ( | long | val, | |
bool | encodeLen, | |||
bool | signExtend | |||
) |
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.
- Parameters:
-
val 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.
Implemented in Asn1PerEncodeBuffer.
void EncodeInt | ( | long | val, | |
bool | encodeLen, | |||
bool | signExtend, | |||
System.String | ident | |||
) |
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.
- Parameters:
-
val 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 Bit field identifier name for tracing.
Implemented in Asn1PerEncodeBuffer.
void EncodeInt | ( | long | val, | |
int | nbits | |||
) |
This method encodes bit values from an integer value.
The least significant bits from the integer are encoded.
- Parameters:
-
val Integer containing bits to be encoded nbits Number of bits to encode
Implemented in Asn1PerEncodeBuffer.
void EncodeInt | ( | long | val, | |
int | nbits, | |||
System.String | ident | |||
) |
This method encodes bit values from an integer value.
The least significant bits from the integer are encoded.
- Parameters:
-
val Integer containing bits to be encoded nbits Number of bits to encode ident Bit field identifier name for tracing.
Implemented in Asn1PerEncodeBuffer.
void EncodeLength | ( | long | val, | |
long | lower, | |||
long | upper | |||
) |
This method encodes a constrained length determinant value.
- Parameters:
-
val Length value to be encoded lower Lower bound (inclusive) of length value range upper Upper bound (inclusive) of length value range
Implemented in Asn1PerEncodeBuffer.
long EncodeLength | ( | long | val | ) |
This method encodes a general (unconstrained) length determinant value as described in section 10.9 or the X.691 standard.
- Parameters:
-
val Length value to be encoded
- Returns:
- Value that was actually encoded. This may be less than the value that was passed in if fragementation was done (i.e the value was >= 16k).
Implemented in Asn1PerEncodeBuffer.
void EncodeLengthEOM | ( | long | val | ) |
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.
- Parameters:
-
val Original length value that was encoded.
Implemented in Asn1PerEncodeBuffer.
void EncodeOctetString | ( | byte[] | val, | |
int | offset, | |||
int | nbytes | |||
) |
This method encodes the given array of bytes as an unconstrained octet string value.
- Parameters:
-
val 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
Implemented in Asn1PerEncodeBuffer.
void EncodeOIDLengthAndValue | ( | int[] | val | ) |
This method encodes the length and contents of an object identifier value.
- Parameters:
-
val Integer array containing arcs to encode
Implemented in Asn1PerEncodeBuffer.
void EncodeOpenType | ( | byte[] | val, | |
int | offset, | |||
int | nbytes | |||
) |
This method encodes the given array of bytes as an open type.
- Parameters:
-
val 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
Implemented in Asn1PerEncodeBuffer.
void EncodeRelOIDLengthAndValue | ( | int[] | val | ) |
This method encodes the length and contents of a relative object identifier value.
- Parameters:
-
val Integer array containing arcs to encode
Implemented in Asn1PerEncodeBuffer.
void EncodeSmallLength | ( | int | val | ) |
This method implements the rules to encode a normally small length as specified in section 11.9 of the X.691 standard.
- Parameters:
-
val Value to be encoded
Implemented in Asn1PerEncodeBuffer.
void EncodeSmallNonNegWholeNumber | ( | int | val | ) |
whole number as specified in section 10.6 of the X.691 standard.
This method implements the rules to encode a small non-negative
- Parameters:
-
val Value to be encoded
Implemented in Asn1PerEncodeBuffer.