Microsoft XML Core Services (MSXML) 5.0 for Microsoft Office - Digital Signatures

setStoreHandle Method

[This feature was first implemented for MSXML 5.0.]

Sets a certificate store handle on the signature object, so that certificate information can be inserted into the <ds:KeyInfo> element.

This method is callable in C/C++ applications only.

C/C++ Syntax

HRESULT setStoreHandle (void* hCertStore);

Parameters

hCertStore
Handle to a certificate store created using CryptoAPI functions, such as CertOpenSystemStore or CertOpenStore.

Return Values

S_OK
Certificate store handle was set without error.
E_FAIL
Failed to set the certificate store handle.

Remarks

Calling this method releases all the certificates previously assigned to this object.

Example

The example below is functionally similar to the store property example. It shows the effect of setting the certificate store on an IXMLDigitalSignatureEx object by calling the setStoreHandle method. When a signature is signed without calling this method and the CERTIFICATES flag is set in the call to the sign method, the resultant signature document contains the certificate of the key used in sign. However, when the signature is signed after this method is called to set the certificate store, the resultant signature document contains all the certificates in the store, in addition to the certificate of the key used in sign.

In this example, the certificate store has three certificates. So the signed signature document contains four <ds:Certificate> entries, two of which are identical.

Applies To

IXMLDigitalSignatureEx

Versioning

MSXML 5.0 and later

To view reference information for Visual Basic, C/C++, or Script only, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

IXMLDigitalSignatureEx Interface | sign Method | verify Method | store Property