What does HRESULT 0x8009310E (CRYPT_E_ASN1_UTF8) mean?

 
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


Looking for a different code? Search another status or error code.