getVerifyingCertificate Method

MSXML 5.0 SDK

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

getVerifyingCertificate Method

[This feature was first implemented for MSXML 5.0.]

Retrieves the certificate associated with this key used to verify a signature.

[JScript]

Script Syntax

var oCertificate = IXMLDSigKeyEx.getVerifyingCertificate();
[Visual Basic]

Visual Basic Syntax

Set oCertificate = IXMLDSigKeyEx.getVerifyingCertificate
[C/C++]

C/C++ Syntax

HRESULT getVerifyingCertificate (IUnknown** oCertificate);

C/C++ Syntax Using Smart Pointers

IUnknownPtr oCertificate = IXMLDSigKeyEx.getVerifyingCertificate();

Parameters

oCertificate
In C/C++ applications not using smart pointer classes, this is a reference to the certificate associated with the key. In all other cases, this is the certificate of the key.

Return Values

S_OK
The method call was successful.
E_FAIL
The method call failed.

Remarks

You must call this method after a signature is verified.

If the signature contains a certificate, this method returns the certificate of the key. If the signature contains no certificate, the resultant oCertificate parameter is NULL.

Example

The following example demonstrates how to validate the certificate used in the signature verification. A signed signature document containing a certificate is first verified before the certificate is validated by examining the root certificate. In any production code, a more sophisticated validation procedure should be followed.

The signed signature document is used as the input for the code examples in C/C++, JScript, and Visual Basic. The output is the same in each language.

Applies To

IXMLDigitalSignature, IXMLDigitalSignatureEx

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.