Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
virtual P6R::P6ERR P6R::p6IAsn1_2::decodeOctetString_2 ( P6UINT8 pBuffer,
P6UINT32  bufSize,
P6UINT32 pIndex,
P6ASN1OCTET pValue 
)
pure virtual

Copy an octet string (binary array) from pBuffer into the P6R's defined "P6ASN1OCTET" type.

This function handles all length details and once successfully done moves the index parameter to the start of the next type in pBuffer.

It is the caller's responsibility to make sure that the value P6ASN1OCTET parameter has a sufficiently large byte buffer (value.pBytes) to hold the OCTET STRING at "pBuffer[ index ]". The caller can determine how big the buffer must be by setting value.pBytes to NULL. The required length will be returned in the parameter value.length. ** Determining the length of the OCTET STRING will not result in a change to the index parameter (thus allowing a second call to extract the string). **

NOTE, that "pBuffer[ index ]" MUST point to the start of the length field of the OCTET STRING. That is the tag associated with the ASN.1 type should have already been processed by the caller and skipped. This function does not understand BER tags, but assumes that the caller does and has positioned pBuffer[ index ] to decode the length and value of the OCTET STRING.

Parameters
pBuffer[ in ] Byte array containg the ASN.1 encoded data to decode
bufSize[ in ] the amount of data (in bytes) pointed to by pBuffer
pIndex[ in ] current offset into pBuffer, should be pointing to the length field of an integer tagged value [ out ] this index moves down the pBuffer data as the data is decoded
pValue[ out ] An octet string of length zero is legal and supported
Returns
SuccessP6R::eOk 
FailureP6R::eNotInitializedA successful call to initialize was not made before this call.
P6R::eTooBigvalue.pBytes is too small to hold the OCTET STRING
P6R::eInvalidArgOne of the parameters is NULL.
errors from decodeLength()This function calls decodeLength.