| Previous | Next |
| CRYPT_E_ASN1_RULE | CRYPT_E_ASN1_PDU_TYPE |
CRYPT_E_ASN1_UTF8
UTF8String must contain well-formed UTF-8
CRYPT_E_ASN1_UTF8 means the contents octets of an ASN.1 UTF8String are not a valid UTF-8 sequence. Invalid continuation bytes, truncated multibyte sequences, overlong encodings, UTF-16 surrogate code points, and values above U+10FFFF are not accepted as alternate spellings of Unicode characters.
This differs from CRYPT_E_INVALID_PRINTABLE_STRING or CRYPT_E_INVALID_IA5_STRING. Those values may contain valid text that is outside a restricted alphabet; this error means the UTF-8 byte sequence itself cannot be decoded into Unicode scalar values.
Safe investigation
- Inspect the original octets before any replacement-character conversion.
- Validate UTF-8 strictly and report the first invalid byte offset.
- Do not reinterpret UTF-16LE bytes as UTF-8.
- Regenerate the ASN.1 string from normalized Unicode text using a conforming encoder, then compare the resulting DER octets.
References
- RFC 3629: UTF-8 syntax and invalid sequences
- ITU-T X.680: UTF8String
- Microsoft: certificate enrollment string types
Looking for a different code? Search another status or error code.