| Previous | Next |
| CRYPT_E_INVALID_IA5_STRING | CRYPT_E_NOT_CHAR_STRING |
CRYPT_E_INVALID_X500_STRING
An X.500 name string has grammar as well as text
CRYPT_E_INVALID_X500_STRING is returned when a textual distinguished name cannot be converted to an encoded certificate name. The failure can be in an attribute key or OID, an unescaped delimiter, quoting, a missing value, or the ordering and grouping of relative distinguished names. Commas and plus signs are structural characters unless correctly quoted or escaped.
The displayed form of a distinguished name is not a unique serialization. CertStrToName accepts specific Windows formatting flags, while CertNameToStr can emit several textual forms. Round-tripping through an ad hoc parser can therefore alter multi-valued RDNs or escaped values.
How to isolate the syntax error
- Use the error-position output from
CertStrToNamewhen available. - Validate attribute names or provide numeric OIDs for custom attributes.
- Quote or escape commas, plus signs, equals signs, and leading or trailing spaces.
- Build
CERT_NAME_INFOstructures directly when exact RDN grouping matters.
References
Looking for a different code? Search another status or error code.