ASN1C C# Runtime Library  7.2
Public Member Functions | List of all members
Asn1OerDecodeBuffer Class Reference
Inheritance diagram for Asn1OerDecodeBuffer:
Asn1DecodeBitBuffer Asn1DecodeBuffer Asn1MessageBuffer Asn1MessageBufferBase

Public Member Functions

 Asn1OerDecodeBuffer (byte[] msgdata)
 
 Asn1OerDecodeBuffer (System.IO.Stream istream)
 
long DecodeIntSigned (int octets)
 
long DecodeIntSigned ()
 
long DecodeIntUnsigned (int octets)
 
long DecodeIntUnsigned ()
 
int DecodeQuantity ()
 
void DecodeTag (Asn1Tag tag)
 
long DecodeVarUnsigned (int octets)
 
bool GetCanonicalMode ()
 
void SetCanonicalMode (bool value)
 
- Public Member Functions inherited from Asn1DecodeBitBuffer
 Asn1DecodeBitBuffer (byte[] msgdata)
 
 Asn1DecodeBitBuffer (System.IO.Stream istream)
 
virtual void ByteAlign ()
 
virtual bool DecodeBit ()
 
virtual int DecodeBitsToInt (int nbits)
 
virtual long DecodeBitsToLong (int nbits)
 
virtual void DecodeBitsToOctetArray (byte[] data, int offset, int nbits)
 
virtual void DecodeBitsToOctetArray (byte[] data, int offset, int bitOffset, int nbits)
 
void MoveBitCursor (long offset)
 
sealed override int ReadByte ()
 
sealed override void SetInputStream (byte[] msgdata, int offset, int length)
 
- Public Member Functions inherited from Asn1DecodeBuffer
virtual void AddCaptureBuffer (System.IO.MemoryStream buffer)
 
virtual void Capture (int nbytes)
 
virtual long DecodeIntValue (int length, bool signExtend)
 
virtual int [] DecodeOIDContents (int llen)
 
virtual int [] DecodeRelOIDContents (int llen)
 
override System.IO.Stream GetInputStream ()
 
virtual void HexDump ()
 
virtual void Mark ()
 
virtual int Read ()
 
virtual void Read (byte[] buffer, int offset, int nbytes)
 
virtual void Read (byte[] buffer)
 
int Read2Bytes ()
 
int Read4Bytes ()
 
virtual void RemoveCaptureBuffer (System.IO.MemoryStream buffer)
 
virtual void Reset ()
 
virtual long Skip (long nbytes)
 
- Public Member Functions inherited from Asn1MessageBuffer
virtual void AddNamedEventHandler (Asn1NamedEventHandler handler)
 
virtual void InvokeCharacters (System.String svalue)
 
virtual void InvokeEndElement (System.String name, int index)
 
virtual void InvokeStartElement (System.String name, int index)
 
- Public Member Functions inherited from Asn1MessageBufferBase
void SetKey (byte[] rtkey)
 
void SetPermanentKey (byte[] rtkey)
 

Additional Inherited Members

- Static Public Member Functions inherited from Asn1MessageBufferBase
static void HexDump (System.IO.Stream ins, System.IO.StreamWriter outs)
 
static void HexDump (System.IO.Stream ins)
 
- Properties inherited from Asn1DecodeBitBuffer
virtual long BitOffset [get]
 
virtual int MsgBitCnt [get]
 
- Properties inherited from Asn1DecodeBuffer
virtual int ByteCount [get]
 
bool LazyOpenTypeDecode [get, set]
 
- Properties inherited from Asn1MessageBuffer
virtual Asn1MessageBuffer EventHandlerList [set]
 
- Properties inherited from Asn1MessageBufferBase
Asn1Context Context [get]
 
virtual short TypeCode [set]
 

Constructor & Destructor Documentation

◆ Asn1OerDecodeBuffer() [1/2]

Asn1OerDecodeBuffer ( byte []  msgdata)

This constructor creates a BER decode buffer object that references an encoded ASN.1 message.

Parameters
msgdataByte array containing an encoded ASN.1 message.

◆ Asn1OerDecodeBuffer() [2/2]

Asn1OerDecodeBuffer ( System.IO.Stream  istream)

This constructor creates a BER decode buffer object that references an encoded ASN.1 message.

In this case, the message is passed in using an InputStream object.

Parameters
istreamInput stream containing an encoded ASN.1 message.

Member Function Documentation

◆ DecodeIntSigned() [1/2]

long DecodeIntSigned ( int  octets)

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

Note: this function will do sign-extension so that if a negative value was encoded in less than 8 bytes, the returned long will be that value (and not some positive value).

Parameters
octets;0 < octets <= 8
Returns

Referenced by Asn1Integer.Decode(), Asn1UniversalString.Decode(), Asn1TimeUtil.DecodeDateTime(), Asn1TimeUtil.DecodeDuration(), Asn1Integer.DecodeSigned(), and Asn1BigInteger.DecodeSigned().

◆ DecodeIntSigned() [2/2]

long DecodeIntSigned ( )

Decode an integer value as a variable length, signed integer, including decoding the length, according to OER.

This is used for integer values that have a lower bound less than -2^63, no lower bound, or a lower bound less than zero in combination with an upper bound greater than 2^63–1, or no upper bound. (In other words, it doesn't fit in a signed 64-bit integer.)

◆ DecodeIntUnsigned() [1/2]

long DecodeIntUnsigned ( int  octets)

Decode an unsigned integer value (a binary integer, not 2's complement form), of the given length. /p>

Parameters
octetsThe number of octets; 0 < octets <= 8

Referenced by Asn1BitString.Decode(), Asn1TimeUtil.DecodeDateTime(), Asn1TimeUtil.DecodeDuration(), Asn1Integer.DecodeUnsigned(), and Asn1BigInteger.DecodeUnsigned().

◆ DecodeIntUnsigned() [2/2]

long DecodeIntUnsigned ( )

Decode an integer value as a variable length, unsigned integer, including decoding the length, according to OER. This is used for integer values that are constrained to be non-negative but which have no upper bound or an upper bound greater than 2^64 - 1.

◆ DecodeQuantity()

int DecodeQuantity ( )

Decode an OER quantity (used for SEQUENCE-OF and SET-OF)

Returns
Exceptions
IOException

◆ DecodeTag()

void DecodeTag ( Asn1Tag  tag)

Decode a tag encoded in OER.

Parameters
tagObject to decode into.

References Asn1Tag.mClass, and Asn1Tag.mIDCode.

◆ DecodeVarUnsigned()

long DecodeVarUnsigned ( int  octets)

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

This will throw an exception if canonical mode is set and the encoding used extra bytes.

Note: if octets >= 8, this method will throw an exception if the encoded integer is outside the range of a long; the exception is not necessarily thrown as the integer might not have been encoded in the minimal number of octets.

Parameters
octetsThe number of octets; 0 < octets

◆ GetCanonicalMode()

bool GetCanonicalMode ( )

Return true if canonical mode has been indicated by calling SetCanonicalMode(true);

Referenced by Asn1Boolean.Decode(), and Asn1BitString.Decode().

◆ SetCanonicalMode()

void SetCanonicalMode ( bool  value)

Turn canonical mode on/off. Turning canonical mode on acts as a signal to both generated code and runtime code that the user wants to enforce the canonical OER rules. It is not required to turn on canonical mode just because the encoding is canonical.