Partager via


setStoreHandle Method

 

[This sample code uses features that were implemented in MSXML 5.0 for Microsoft Office Applications. XML digital signatures are not supported in MXSML 6.0 and later.]

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 for Microsoft Office Applications and later

See Also

IXMLDigitalSignatureEx
sign Method
verify Method
store Property