CryptoSys PKI Pro Manual

UTF-8 encoding in distinguished names

If the PKI_X509_UTF8 flag is specified in nOptions, all new DN attribute strings will be encoded as UTF8String.

If the UTF-8 flag is set and the value contains only valid UTF-8-encoded characters, then the string will be copied directly. Otherwise the input is assumed to be 8-bit Latin-1 and will be converted to UTF-8 accordingly, with each 8-bit character being converted to two UTF-8 bytes.

Input stringDefault encodingWith PKI_X509_UTF8
OU=abcPrintableString "abc"UTF8String "abc"
OU=#x616263PrintableString "abc"UTF8String "abc"
OU='a\62c'PrintableString "abc"UTF8String "abc"
C=M\e9xicoT61String "México"UTF8String "México"
C=#x4de97869636fT61String "México"UTF8String "México"
C=#x4dc3a97869636fT61String (garbage!)UTF8String "México"
CN=#xE5A4A7E58DABT61String (garbage!)UTF8String (U+5927,U+536B)
CN='\E5\A4\A7\E5\8D\AB'T61String (garbage!)UTF8String (U+5927,U+536B)

The last two examples give the same result as two CJK ideographs, U+5927 (da) and U+536B (wei), encoded in UTF-8. See the second example in X509_MakeCertSelf.

[PREV: Default encoding...]   [Contents]   [Index]   
   [NEXT: Specifying an arbitrary RDN in a distinguished name...]

Copyright © 2004-24 D.I. Management Services Pty Ltd. All rights reserved. Generated 2024-09-23T07:52:09Z.