Extracts a key from a specified cryptographic service provider (CSP) and a specified key container. The resultant key can be used to sign or verify a signature.
var objKey = objXMLDigitalSignature.createKeyFromCSP( cspType, cspName, keyContainerName, flag);
var objKey = objXMLDigitalSignature.createKeyFromCSP( _ cspType, _ cspName, _ keyContainerName, _ flag)
IXMLDSigKeyPtr objKey = objXMLDigitalSignature->createKeyFromCSP( long cspType, _bstr_t cspName, _bstr_t keyContainerName, DWORD flag );
HRESULT createKeyFromCSP( long cspType, BSTR cspName, BSTR keyContainerName, long flag, IXMLDSigKey** objKey);
IXMLDSigKey
interface. In JScript, Visual Basic, and C/C++ with smart pointer class wrappers, this is the key object itself. The resultant key object can then be used in the call to the sign
method or the verifiy
method.This methods returns the standard CryptoAPI return values, including the following:
A digital certificate must have been installed locally for the createKeyFromCSP
method to work properly.
This example illustrates how to use the createKeyFromCSP
method to generate a cryptographic key from the installed CSP, and uses this key to sign a document.
We've provided source files for the sample in three languages: JScript, Visual Basic, and C++. The output is the same in each language.
IXMLDigitalSignature | IXMLDigitalSignatureEx
MSXML 5.0 and later
To view reference information for Visual Basic, C/C++, or Script only, click the Language Filter button in the upper-left corner of the page.
IXMLDigitalSignatureEx | createKeyFromCertContext Method | createKeyFromHMACSecret Method | createKeyFromHMACSectetBinary Method | createKeyFromNode Method | sign Method | verify Method