getCSPHandle Method

MSXML 5.0 SDK

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

getCSPHandle Method

[This feature was first implemented for MSXML 5.0.]

Retrieves the handle to the cryptographic service provider associated with this key object. The resultant CSP handle can be used in the appropriate CryptoAPI functions to perform other Cryptographic operations.

[C/C++]

C/C++ Syntax

HRESULT getCSPHandle (ULONG_Ptr *hCSProv);

C/C++ Syntax Using Smart Pointers

ULONG_Ptr hCSProv = objIXMLDSigKeyEx.getCSPHandle();

Parameters

hCSProv
Handle to the cryptographic service provider associated with this key object.

Return Values

S_OK
The handle was retrieved successfully.
E_FAIL
Failed to retrieve the handle and the resultant hCSProv parameter is NULL.

Remarks

When the key object is created using the IXMLDigitalSignature::createKeyFromCSP method, you can call this method to get the handle to the underlying cryptographic service provider. You can examine and use other cryptographic information associated with this key by calling the appropriate CryptoAPI functions.

For keys created by IXMLDigitalSignature::createKeyFromHMACSecret or IXMLDigitalSignatureEx::createKeyfromHMACSecretBinary, no CSP handles will be created and the resultant hCSProv parameter will be NULL.

Applies To

IXMLDSigKeyEx

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

createKeyFromCSP Method