ASN1C C# Runtime Library  7.8
Public Member Functions | List of all members
Asn1PerEncoder Interface Reference
Inheritance diagram for Asn1PerEncoder:
Asn1PerEncodeBuffer

Public Member Functions

void EncodeBit (bool val)
 
void EncodeBit (bool val, System.String ident)
 
void EncodeBits (byte val, int nbits)
 
void EncodeBits (byte[] val, int offset, int nbits)
 
void EncodeBits (byte[] val, int offset, int nbits, System.String ident)
 
void EncodeCharString (System.String val, int nchars, int offset, int abpc, int ubpc, Asn1CharSet charSet)
 
void EncodeConsWholeNumber (long adjustedValue, long rangeValue, System.String ident)
 
void EncodeConsWholeNumber (long adjustedValue, long rangeValue)
 
void EncodeInt (long val, int nbits, System.String ident)
 
void EncodeInt (long val, int nbits)
 
void EncodeInt (long val, bool encodeLen, bool signExtend, System.String ident)
 
void EncodeInt (long val, bool encodeLen, bool signExtend)
 
long EncodeLength (long val)
 
void EncodeLength (long val, long lower, long upper)
 
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)
 

Detailed Description

Member Function Documentation

◆ EncodeBit() [1/2]

void EncodeBit ( bool  val)

This method encodes a single bit value.

Parameters
valBoolean value of bit to be encoded.

Implemented in Asn1PerEncodeBuffer.

Referenced by Asn1TimeUtil.EncodeDateTime(), and Asn1TimeUtil.EncodeDuration().

◆ EncodeBit() [2/2]

void EncodeBit ( bool  val,
System.String  ident 
)

This method encodes a single bit value.

Parameters
valBoolean value of bit to be encoded.
identBit field identifier name for tracing.

Implemented in Asn1PerEncodeBuffer.

◆ EncodeBits() [1/3]

void EncodeBits ( byte  val,
int  nbits 
)

This method encodes bit values from an octet.

The most significant bits from the octet are encoded.

Parameters
valOctet containing bits to be encoded
nbitsNumber of bits to encode

◆ EncodeBits() [2/3]

void EncodeBits ( byte []  val,
int  offset,
int  nbits 
)

This method encodes bit values from an array of octets.

Parameters
valOctet array containing bits to be encoded
offsetStarting byte offset in value
nbitsNumber of bits to encode

Implemented in Asn1PerEncodeBuffer.

◆ EncodeBits() [3/3]

void EncodeBits ( byte []  val,
int  offset,
int  nbits,
System.String  ident 
)

This method encodes bit values from an array of octets.

Parameters
valOctet array containing bits to be encoded
offsetStarting byte offset in value
nbitsNumber of bits to encode
identBit field identifier name for tracing.

Implemented in Asn1PerEncodeBuffer.

◆ EncodeCharString()

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
valString containing characters to encode
ncharsNumber of characters from string to encode
offsetOffset to first char in string to encode
abpcNumber of bits per character (aligned)
ubpcNumber of bits per character (unaligned)
charSetObject representing permitted alphabet constraint character set (optional)

Implemented in Asn1PerEncodeBuffer.

◆ EncodeConsWholeNumber() [1/2]

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
adjustedValueAdjusted value to be encoded = value - lower range endpoint value
rangeValuelower - upper + 1
identBit field identifier name for tracing.

Implemented in Asn1PerEncodeBuffer.

Referenced by Asn1TimeUtil.EncodeDuration(), and Asn1Integer.EncodeValue().

◆ EncodeConsWholeNumber() [2/2]

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
adjustedValueAdjusted value to be encoded = value - lower range endpoint value
rangeValuelower - upper + 1

Implemented in Asn1PerEncodeBuffer.

◆ EncodeInt() [1/4]

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
valInteger containing bits to be encoded
nbitsNumber of bits to encode
identBit field identifier name for tracing.

Implemented in Asn1PerEncodeBuffer.

Referenced by Asn1TimeUtil.EncodeDate(), Asn1TimeUtil.EncodeDateTime(), Asn1TimeUtil.EncodeDuration(), and Asn1TimeUtil.EncodeTime().

◆ EncodeInt() [2/4]

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
valInteger containing bits to be encoded
nbitsNumber of bits to encode

Implemented in Asn1PerEncodeBuffer.

◆ EncodeInt() [3/4]

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
valInteger value to be encoded
encodeLenFlag indicating length determinant should be encoded before encoding integer value.
signExtendFlag indicating if sign extension should be performed.
identBit field identifier name for tracing.

Implemented in Asn1PerEncodeBuffer.

◆ EncodeInt() [4/4]

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
valInteger value to be encoded
encodeLenFlag indicating length determinant should be encoded before encoding integer value.
signExtendFlag indicating if sign extension should be performed.

Implemented in Asn1PerEncodeBuffer.

◆ EncodeLength() [1/2]

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
valLength 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.

◆ EncodeLength() [2/2]

void EncodeLength ( long  val,
long  lower,
long  upper 
)

This method encodes a constrained length determinant value.

Parameters
valLength value to be encoded
lowerLower bound (inclusive) of length value range
upperUpper bound (inclusive) of length value range

Implemented in Asn1PerEncodeBuffer.

◆ EncodeLengthEOM()

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
valOriginal length value that was encoded.

Implemented in Asn1PerEncodeBuffer.

◆ EncodeOctetString()

void EncodeOctetString ( byte []  val,
int  offset,
int  nbytes 
)

This method encodes the given array of bytes as an unconstrained octet string value.

Parameters
valByte array containing data to encode. This is assumed to contain a previously encoded PER component.
offsetStarting offset in byte array value
nbytesNumber of bytes to encode

Implemented in Asn1PerEncodeBuffer.

◆ EncodeOIDLengthAndValue()

void EncodeOIDLengthAndValue ( int []  val)

This method encodes the length and contents of an object identifier value.

Parameters
valInteger array containing arcs to encode

Implemented in Asn1PerEncodeBuffer.

◆ EncodeOpenType()

void EncodeOpenType ( byte []  val,
int  offset,
int  nbytes 
)

This method encodes the given array of bytes as an open type.

Parameters
valByte array containing data to encode. This is assumed to contain a previously encoded PER component.
offsetStarting offset in byte array value
nbytesNumber of bytes to encode

Implemented in Asn1PerEncodeBuffer.

◆ EncodeRelOIDLengthAndValue()

void EncodeRelOIDLengthAndValue ( int []  val)

This method encodes the length and contents of a relative object identifier value.

Parameters
valInteger array containing arcs to encode

Implemented in Asn1PerEncodeBuffer.

◆ EncodeSmallLength()

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
valValue to be encoded

Implemented in Asn1PerEncodeBuffer.

◆ EncodeSmallNonNegWholeNumber()

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
valValue to be encoded

Implemented in Asn1PerEncodeBuffer.