共用方式為


IXpsSignature::Verify method

Verifies the signature against a specified X.509 certificate.

Syntax

HRESULT Verify(
  [in]          const CERT_CONTEXT         *x509Certificate,
  [out, retval]       XPS_SIGNATURE_STATUS *sigStatus
);

Parameters

  • x509Certificate [in]
    The CERT_CONTEXT structure that contains the X.509 certificate that will be used for verification.

    If the signature is not incomplete or incompliant, this certificate will be used only to validate that the signed data in the XPS package is intact. The certificate will not be used to perform any other checks. Before using the certificate the application is expected to verify the trust chain and any other requirements.

  • sigStatus [out, retval]
    The XPS_SIGNATURE_STATUS value that describes the results of the verification.

Return value

The method returns an HRESULT. Possible values include, but are not limited to, those in the table that follows. For return values that are not listed in this table, see XPS Digital Signature API Errors and XPS Document Errors.

Return code Description
S_OK

The method succeeded.

E_POINTER

x509Certificate or sigStatus is NULL.

E_UNEXPECTED

The interface is not connected to the signature manager.

 

Remarks

This method detects the signature status in the order that is specified in section 10.2.1.2 of the XML Paper Specification. The sequence of detection is as follows: incompliant, incomplete, broken, questionable, and, finally, valid. This means that if, for example, a signature is found to be incompliant, no digest will be calculated if the signature is also broken.

For more information on the different types of signature statuses that can be detected by this method, see XPS_SIGNATURE_STATUS.

Requirements

Minimum supported client

Windows 7 [desktop apps only]

Minimum supported server

Windows Server 2008 R2 [desktop apps only]

Header

Xpsdigitalsignature.h

IDL

XpsDigitalSignature.idl

See also

IXpsSignature

CERT_CONTEXT

IOpcDigitalSignature

IXpsSignatureManager

XPS_SIGNATURE_STATUS

XPS Digital Signature API Errors

XPS Document Errors

XML Paper Specification