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 |
index | [ 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
Success | P6R::eOk | |
Failure | P6R::eNotInitialized | A successful call to initialize was not made before this call. |
P6R::eInvalidArg | pBuffer is set to NULL. |
P6R::eTooBigg | Insufficient buffer space required for the encoding. |