| Previous | Next |
| MQ_ERROR_PUBLIC_KEY_NOT_FOUND | MQ_ERROR_ILLEGAL_MQPRIVATEPROPS |
MQ_ERROR_PUBLIC_KEY_DOES_NOT_EXIST
Interpretation
When MQ_ERROR_PUBLIC_KEY_DOES_NOT_EXIST appears, start with the queue operation and its property arrays rather than with a broad repair of the Message Queuing service. Its diagnostic boundary is directory object has no registered encryption public key. This differs from directory unreachability: the lookup completed and the key attribute was absent.
For MQ_ERROR_PUBLIC_KEY_DOES_NOT_EXIST, encryption capability and message authentication are related but distinct. When diagnosing MQ_ERROR_PUBLIC_KEY_DOES_NOT_EXIST, preserve provider, algorithm, certificate, key-container, and queue authentication/privacy settings rather than collapsing them into one “SSL” diagnosis.
When diagnosing MQ_ERROR_PUBLIC_KEY_DOES_NOT_EXIST, authenticated MSMQ messages combine a sender identity, certificate, private key, hash/signature algorithm, and queue policy. In the MQ_ERROR_PUBLIC_KEY_DOES_NOT_EXIST path, successful certificate parsing does not prove that the key is accessible to the sending process.
Relevant API contract
| Subsystem | MSMQ message authentication, certificate registration, signing, hashing, and encryption |
|---|---|
| Decisive boundary | certificate identity, key availability, provider capability, and message policy are independent checks |
| Code-specific focus | directory object has no registered encryption public key |
| Primary recovery rule | Register/publish the destination key and allow replication before retrying encrypted sends. |
When diagnosing MQ_ERROR_PUBLIC_KEY_DOES_NOT_EXIST, queue ACLs, certificate trust, private-key access, provider support, and destination authentication policy are independent. Test the layer named by the evidence. For MQ_ERROR_PUBLIC_KEY_DOES_NOT_EXIST, the code-specific boundary is directory object has no registered encryption public key.
Decisive observations
- Certificate store location and security identity used by the process; associate it explicitly with
MQ_ERROR_PUBLIC_KEY_DOES_NOT_EXIST. - When diagnosing
MQ_ERROR_PUBLIC_KEY_DOES_NOT_EXIST, provider name/type, hash algorithm, and privacy/authentication properties; capture the value before cleanup or retry changes it. - In the
MQ_ERROR_PUBLIC_KEY_DOES_NOT_EXISTpath, whether the failure occurred while preparing, sending, storing, or validating the message; compare it with a known-good call using the same account and queue type. - For this
MQ_ERROR_PUBLIC_KEY_DOES_NOT_EXISTresult, record the queue path or format name, local/remote placement, transactional flag, caller SID, process build, and UTC correlation ID when they apply.
For MQ_ERROR_PUBLIC_KEY_DOES_NOT_EXIST, log certificate thumbprints, provider names, SIDs, GUIDs, lengths, and hashes where useful, but do not log private keys, symmetric keys, credentials, or confidential message bodies.
Troubleshooting workflow
- Record the unsigned HRESULT,
MQ_ERROR_PUBLIC_KEY_DOES_NOT_EXIST, and the native API or COM method before a framework replaces it with a generic exception. - When diagnosing
MQ_ERROR_PUBLIC_KEY_DOES_NOT_EXIST, verify the postcondition after the failed call: queue existence, message presence, directory object state, transaction outcome, or generated output may differ by result. - In the
MQ_ERROR_PUBLIC_KEY_DOES_NOT_EXISTpath, capture provider name/type, hash algorithm, and privacy/authentication properties. - For this
MQ_ERROR_PUBLIC_KEY_DOES_NOT_EXISTresult, capture whether the failure occurred while preparing, sending, storing, or validating the message. - Reproduce with the smallest queue/message/property set that still returns
MQ_ERROR_PUBLIC_KEY_DOES_NOT_EXIST; change one precondition at a time. - When diagnosing
MQ_ERROR_PUBLIC_KEY_DOES_NOT_EXIST, apply the code-specific recovery rule: Register/publish the destination key and allow replication before retrying encrypted sends.
Recovery rules
Register/publish the destination key and allow replication before retrying encrypted sends.
When diagnosing MQ_ERROR_PUBLIC_KEY_DOES_NOT_EXIST, the retry decision must account for side effects that may already exist. In the MQ_ERROR_PUBLIC_KEY_DOES_NOT_EXIST path, query queue, message, directory, or transaction state first whenever the result leaves completion uncertain.
Differences that matter
In the MQ_ERROR_PUBLIC_KEY_DOES_NOT_EXIST path, authentication failure is not synonymous with queue access denial. For this MQ_ERROR_PUBLIC_KEY_DOES_NOT_EXIST result, certificate stores, private keys, providers, signatures, and queue policy must be tested separately. The specific focus for MQ_ERROR_PUBLIC_KEY_DOES_NOT_EXIST remains directory object has no registered encryption public key.
- In the
MQ_ERROR_PUBLIC_KEY_DOES_NOT_EXISTpath, changing queue names, deleting directory objects, or recreating certificates without reconciliation can create a second object while callers still reference the first. - For this
MQ_ERROR_PUBLIC_KEY_DOES_NOT_EXISTresult, A successful test under an interactive administrator account does not prove that the production service account has the same profile, token, directory access, or key permissions.
Practical scenario
A certificate-registration utility encounters MQ_ERROR_PUBLIC_KEY_DOES_NOT_EXIST. For MQ_ERROR_PUBLIC_KEY_DOES_NOT_EXIST, it tests store and private-key access under the production identity before changing queue security. When diagnosing MQ_ERROR_PUBLIC_KEY_DOES_NOT_EXIST, the acceptance test then changes only the decisive precondition and confirms both the HRESULT and the actual queue/message state.
For MQ_ERROR_PUBLIC_KEY_DOES_NOT_EXIST, include a negative test for the nearest misleading diagnosis so monitoring and user guidance do not collapse distinct MSMQ failures into one alert.
Sources
- IETF RFC 5280: Internet X.509 PKI certificate profile — source used for the
MQ_ERROR_PUBLIC_KEY_DOES_NOT_EXISTanalysis. - Microsoft: Message Queuing error and information codes — source used for the
MQ_ERROR_PUBLIC_KEY_DOES_NOT_EXISTanalysis. - Microsoft: authenticated MSMQ message with an external certificate — source used for the
MQ_ERROR_PUBLIC_KEY_DOES_NOT_EXISTanalysis. - Microsoft: MSMQMessage object and message properties — source used for the
MQ_ERROR_PUBLIC_KEY_DOES_NOT_EXISTanalysis. - Microsoft: Windows certificate stores — source used for the
MQ_ERROR_PUBLIC_KEY_DOES_NOT_EXISTanalysis.
Looking for a different code? Search another status or error code.