What does HRESULT 0x80091005 (CRYPT_E_UNEXPECTED_ENCODING) mean?

 
Previous Next
CRYPT_E_INVALID_MSG_TYPE CRYPT_E_AUTH_ATTR_MISSING

CRYPT_E_UNEXPECTED_ENCODING

The byte stream was encoded differently from what the CryptoAPI call expected. This commonly indicates a mismatch between the input format and the decoding flags or message profile selected by the application.

What to check

  • Confirm that the data is binary CMS/PKCS#7 content and not PEM, base64 text, an unrelated file, or a partially decoded wrapper.
  • Verify the encoding type and message version used by both producer and consumer.
  • Preserve the original bytes for diagnosis; copying through a text channel can corrupt encoded certificate and CMS data.

Microsoft: CryptMsgOpenToDecode

Microsoft: CryptMsgUpdate


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