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

Encoding a boolean value is different in BER and DER encodings.

In BER the value of 'TRUE' can be any non-zero value, while in DER, the value of 'TRUE' must be the integer value of one. For DER the 'boolValue' parameter is ignored.

Note, that an application can always encode a boolean directly by the following steps:

* pBuffer[ index++ ] = BER_boolean; TAG:
* pBuffer[ index++ ] = 1; LENGTH:
* pBuffer[ index++ ] = (deleteOldRdn ? 0xFF : 0 ); VALUE: true is forced to be FF by LDAP spec
*
Parameters
pBuffer[ in out ] 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 ] As the boolean value is encoded in pBuffer this index value increases in value
value[ in ] Zero is reserved to represent the boolean value of 'FALSE'. The P6ASN1TRANSFERENCODING value determines if this parameter is ignored for the value of 'TRUE'.
overrideTag[ in ] can use BER_boolean for standard, or pass in application tag value.
Returns
SuccessP6R::eOk 
FailureP6R::eNotInitializedA successful call to initialize was not made before this call.
P6R::eInvalidArgOne of the parameters is NULL.
P6R::eTooBiggInsufficient buffer space required for the encoding.