Partilhar via


PROPID_QM_ENCRYPTION_PK_ENHANCED

 

Applies To: Windows 10, Windows 7, Windows 8, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server Technical Preview, Windows Vista

(Read-only, introduced in MSMQ 2.0.) The PROPID_QM_ENCRYPTION_PK_ENHANCED property indicates the public encryption key of the computer.

Property ID

PROPID_QM_ENCRYPTION_PK_ENHANCED

Type Indicator

VT_VECTOR | VT_UI1

MQPROPVARIANT Field

caub

Property Value

Array of bytes that contains the public encryption key.

Remarks

The PROPID_QM_ENCRYPTION_PK_ENHANCED property is set by Message Queuing when Message Queuing is installed.

To retrieve the public encryption key of the computer, include PROPID_QM_ENCRYPTION_PK_ENHANCED in the MQQMPROPS structure, and then call MQGetMachineProperties and examine the returned property value.

When calling the MQGetMachineProperties function to retrieve encryption keys, the following two errors may be returned.

MQ_ERROR_PUBLIC_KEY_DOES_NOT_EXIST

This error is returned when the enhanced key is not registered. Message Queuing was able to successfully query the directory service, but the public encryption key was not found.

MQ_ERROR_PUBLIC_KEY_NOT_FOUND

This error is returned when Message Queuing failed to query the directory service. For example, this can happen if the computer calling MQGetMachineProperties is operating offline or if you are trying to retrieve the machine properties of a computer running MSMQ 1.0.

When specifying PROPID_QM_ENCRYPTION_PK_ENHANCED in the MQQMPROPS structure, set its type indicator to VT_NULL. Message Queuing automatically allocates memory for an array of bytes that receives the public encryption key during the function call. A pointer to this array is stored in the pElem member of the caub field of the MQPROPVARIANT structure. After you no longer need this buffer, you must free the memory allocated for it using MQFreeMemory.

Equivalent COM Property

There is no equivalent COM property or method for retrieving the public encryption key of a computer.

Example Code

The following code fragment shows how PROPID_QM_ENCRYPTION_PK_ENHANCED is specified in the MQQMPROPS structure.

aQMPropId[i] = PROPID_QM_ENCRYPTION_PK_ENHANCED; // Property identifier  
aQMPropVar[i].vt = VT_NULL;                      // Type indicator  

See Also

Queue Manager Properties
MQFreeMemory
MQGetMachineProperties
MQQMPROPS
PROPID_QM_ENCRYPTION_PK_BASE