| Previous | Next |
| CRYPT_E_OID_FORMAT | CRYPT_E_UNEXPECTED_ENCODING |
CRYPT_E_INVALID_MSG_TYPE
The operation was requested for a CMS message type that does not support it. Signed, enveloped, and other message forms expose different parameters and controls.
What to check for CRYPT_E_INVALID_MSG_TYPE
- Determine the actual message type before calling a type-specific CryptoAPI operation.
- Verify that code handling a signed message is not attempting a decryption-only operation, and vice versa.
- Read message parameters only after the message has been decoded far enough for that information to be available.
Microsoft: CryptMsgOpenToDecode
Diagnostic interpretation of CRYPT_E_INVALID_MSG_TYPE
CRYPT_E_INVALID_MSG_TYPE has the HRESULT value 0x80091004. AllStat records the condition as “Invalid cryptographic message type.”. For CRYPT_E_INVALID_MSG_TYPE, in practice, interpret that wording at the boundary owned by cryptography, certificate, trust, or key-provider processing, rather than treating the value as a generic Windows message.
Evidence to capture for CRYPT_E_INVALID_MSG_TYPE
- Record the exact COM method or Windows API, its input object, the calling thread, and the full 0x80091004 value before a wrapper converts it to an exception or Boolean result.
- Capture any IErrorInfo text, activity identifier, event-log entry, and subsystem trace that mentions CRYPT_E_INVALID_MSG_TYPE or the crypt / msg / type operation.
- For CRYPT_E_INVALID_MSG_TYPE, check the documented return contract of the specific API because the same HRESULT can require different recovery in different interfaces.
Retry and recovery for CRYPT_E_INVALID_MSG_TYPE
Retry CRYPT_E_INVALID_MSG_TYPE only when the owning API documents a transient state or after the condition described as “Invalid cryptographic message type.” has changed. For CRYPT_E_INVALID_MSG_TYPE, configuration, policy, format, and authorization failures normally require correction first; an immediate loop can hide the original call site and add secondary errors.
Looking for a different code? Search another status or error code.