Hi all,
 
I want to create some certificates which CN has special french characters (like é, è or à...). When I called the function X509_Name_add_entry_by_NID with this special string (like "Fréd Vàlè"), it returns an error.
After debugging the application, i found that it's the function UTF8_getc whose returns the error....
 
This is the part of my code :
 
.....
 
// Create a new X509_NAME for CN element
if( !(n = X509_NAME_new()) )

  goto error;

if( (nid = OBJ_txt2nid( "CN" )) == NID_undef )

  goto error;

// Add the string "Fréd Vàlé" to "CN" (by using MBSTRING_UTF8)

BYTE abValue[] = "Fréd Vàlè";

if( !X509_NAME_add_entry_by_NID( n, nid, MBSTRING_UTF8, abValue, -1, -1, 0 ) )

  goto error;
....

If I put in comment the "UTF8_getc" function, all is OK. But if I tried to parse the created file with the command asn1parse, the string is encoded to ASN1_T61STRING and not to ASN1_UTF8STRING. So why ????
 
 
I supposed that somebody test UTF8 encoding with stressed characters. So what can I do to use correctly UTF8 encoding ?
 
Excuse me for my bad english....
Thanks
 
vincent

 

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to