getCSPHandle 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.]
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++ 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
Versioning
MSXML 5.0 for Microsoft Office Applications and later