The RegisterCertificate method MUST register an MQUSERSIGNCERT ([MS-MQMQ] section 2.2.22) in User.Certificates. Implementations of this protocol use certificates to verify the sender for messages that are requesting authentication and to ensure message integrity.

 HRESULT RegisterCertificate(
   [in, optional] VARIANT* Flags,
   [in, optional] VARIANT* ExternalCertificate
 );

Flags: A pointer to a VARIANT that contains a VT_I4 integer that corresponds to the MQCERT_REGISTER enumeration as defined in the following table.

Value

Meaning

MQCERT_REGISTER_ALWAYS

0x00000001

Register an MQUSERSIGNCERT ([MS-MQMQ] section 2.2.22) in User.Certificates.

If the ExternalCertificate input parameter is not specified or is NULL, the server MUST delete the certificate from the internal store and delete any existing MQUSERSIGNCERT ([MS-MQMQ] section 2.2.22) with a matching Digest property from User.Certificates.

The server MUST then add a newly created MQUSERSIGNCERT ([MS-MQMQ] section 2.2.22) to User.Certificates.

If the ExternalCertificate is not NULL, the server MUST add an MQUSERSIGNCERT ([MS-MQMQ] section 2.2.22), as specified by the ExternalCertificate input parameter, to User.Certificates.

MQCERT_REGISTER_IF_NOT_EXIST

0x00000002

Register an MQUSERSIGNCERT ([MS-MQMQ] section 2.2.22) in User.Certificates only if no certificate is registered in the internal store. This option cannot be used with ExternalCertificate.

If not specified by the client, the server MUST use the default value MQCERT_REGISTER_ALWAYS (0x00000001) instead of the unspecified value.

ExternalCertificate: A pointer to a VARIANT that contains a byte array (VT_ARRAY|VT_UI1) or a pointer (VT_BYREF) to a byte array that specifies the binary representation of the MQUSERSIGNCERT ([MS-MQMQ] section 2.2.22) that is to be registered. The MQUSERSIGNCERT MUST contain an X.509-encoded certificate, as specified in [RFC3280].

Return Values: The method MUST return S_OK (0x00000000) to indicate success or an implementation-specific error HRESULT on failure.<10>

When processing this call, the server MUST follow these guidelines: