[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Extra '0D' inside buffer



Aruna,

When I try to encode DEncX520OrganizationNameContent with Organization name oid as id_at_organizationName.

 

AsnOid id_at_organizationName = { 3, "\125\4\12" };

 

This is getting encoded as 06 03 55 04 0D 0A.

 

Extra ‘OD’ is getting inserted between 04 and 0A.

 

Could any of you suggest me how to resolve this problem. 

You're probably writing the encoded data to a file opened in text mode.

The file needs to be opened in binary mode to prevent carriage return and line feed conversions.

And how do we have to store space in printable string ASN type.

The C library PrintableString is simply a typedef of AsnOcts.

It can be set as follows:

    PrintableString myString;

    myString.octs = "This is my string";

    myString.octetLen = strlen(myString.octs);

 

Hope that helps.

 
- Rich

----------------------------------
Richard E. Nicholas
Secure Systems Consultant
BAE Systems Information Technology
Richard.Nicholas@xxxxxxxxxxxxxxxxx