Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
This property provides an array of bytes that represents the security certificate. The security certificate is used to authenticate messages.
Syntax
HRESULT get_SenderCertificate( VARIANT* pvarSenderCert ); HRESULT put_SenderCertificate( VARIANT varSenderCert ); |
Parameters
- pvarSenderCertor varSenderCert
-
Security certificate, internal or external.
Return Value
The following table describes the common return values.
Value | Description |
---|---|
S_OK |
Success |
E_INVALIDARG |
One or more arguments are invalid |
E_NOTIMPL |
The function contains no implementation |
E_OUTOFMEMORY |
Out of memory |
Remarks
Use SenderCertificatewhen you want to authenticate a small number of messages with the same certificate.
Note: |
---|
When sending a large number of messages using the same certificate, use security context information to attach the certificate. Security context information is obtained by calling MSMQMessage.AttachCurrentSecurityContext. This security context method creates a security context based on the data in MSMQMessage.SenderCertificate. If MSMQMessage.SenderCertificateis not set before calling AttachCurrentSecurityContext, the Message Queuing internal certificate for the user is used for the security context. |
Message Queuing uses the certificate to authenticate the message. However, the receiving application can use the information in an external certificate to verify who sent the message. (When an internal certificate is used, the information in the certificate is not useful to the receiving application.)
The receiving application should use only SenderCertificatewhen an external certificate is sent with the message. After retrieving the certificate, use the CryptoAPI to validate the information in the certificate.
If you do not know if an external or internal certificate was sent, retrieve the certificate and look at its locality attribute. If the locality attribute was set by MSMQ, the certificate is a Message Queuing internal certificate.
You can also set and retrieve the security certificate when using Message Queuing function calls.
Requirements
Header | mqoai.h |
Library | mqoa.lib |
Windows Embedded CE | Windows CE .NET 4.0 and later |
Windows Mobile | Windows Mobile Version 5.0 and later |