IXMLDigitalSignature
[This feature was first implemented for MSXML 5.0.]The IXMLDigitalSignature
interface supports the following properties and methods to allow application developers to sign XML documents or verify signatures.
Properties
signature | This read/write property allows you to get or set a signature template or object to be processed by the IXMLDigitalSignature object. |
store | This read/write property allows you to get or set a certificate store object. |
Methods
createKeyFromCSP | Retrieves a key handle from a key container within a specified cryptographic service provider (CSP). This key handle is used to access the private key used for signing or the public key for signature verification. |
createKeyFromHMACSecret | Extracts and returns a key handle from a base-64 encoded secret value used in the HMAC algorithm. This key handle is used to access a key that can be used for both signing and signature verification. |
createKeyFromNode | Creates and returns a key handle based on the information contained in the <ds:KeyInfo> element and its descendant elements (<ds:KeyInfo> is a child of a <ds:Signature> element). The key handle is used to access the key that is used for signature verification. |
createSAXProxy | Creates and returns a SAX proxy object. The setReferenceData method uses this object to assign a SAX stream as the new data source of the signature object or template. |
setReferenceData | Assigns a new data source to a specified <ds:Reference> element in a signature object. |
sign | Signs data referenced in a <ds:Signature> element. |
verify | Verifies the signature of data referenced in the <ds:Signature> element. |
Events
None.
Remarks
Using the IXMLDigitalSignature
interface typically involves the following tasks.
- Create an XML DOM object, and load it with a digital signature as represented by a
<ds:Signature>
element belonging to thehttp://www.w3.org/2000/09/xmldsig#
namespace. - Create an
IXMLDigitalSignature
object, and assign the XML DOM object to itssignature
property. - Optionally call
setReferenceData
, and possiblycreateSAXProxy
, to set or replace the data source referenced in the signature object. - Create a cryptographic key using one of the key creation methods. See XML Digital Signature Methods for more information.
- Call
sign
orverify
on theIXMLDigitalSignature
object to process the signature on the XML document or fragment. - Optionally call
setReferenceData
to assign a different data source on the signature object, and repeat Step 5 to sign or verify the new data with the existing signature information.
The implementation of the IXMLDigitalSignature
interface conforms to the XML-Signature Syntax and Processing W3C Recommendation 12 February 2002.
Requirements
Implementation: msxml5.dll
Header and IDL files: msxml2.h, msxml2.idl
Version-Dependent ProgID: Msxml2.MXDigitalSignature.5.0
Version-Dependent CLSID: 88d969e5-f192-11d4-a65f-0040963251e5, "MXDigitalSignature50"
Versioning
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.