On 05/20/2014 01:28 PM, Alon Bar-Lev wrote:
> Hi,
>
> I am unsure this is deliberate... the diagnosticMessage contains NULL
> \x0 character at end of string.
>
> Java does not know how to cope properly with these...
>
> Regards,
> Alon Bar-Lev
Could you provide more context in which this is happening? I don't see
anywhere that might be the case.
It's possible that you might be confused about the
ASN1Buffer.addOctetString method. The body of that method looks like:
buffer.append(type);
if (value == null)
{
buffer.append((byte) 0x00);
}
else
{
ASN1Element.encodeLengthTo(value.length, buffer);
buffer.append(value);
}
In this case, the 0x00 is the indicator of the length of the ASN.1 BER
element and not the value. That is, the resulting octet string element
will be encoded as "0400" (which is an empty octet string) and not
"040100" (which is an octet string comprised of the single byte 0x00).
Neil
|