IOpcSigningOptions::SetSignatureMethod method (msopc.h)

Sets the signature method to use to calculate and encrypt the hash value of the SignedInfo element, which will be contained in the SignatureValue element of the signature.

Syntax

HRESULT SetSignatureMethod(
  [in] LPCWSTR signatureMethod
);

Parameters

[in] signatureMethod

The signature method to use.

Return value

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return code Description
S_OK
The method succeeded.
E_POINTER
The signatureMethod parameter is NULL.

Remarks

To access the signature method before the signature is generated, call the IOpcSigningOptions::GetSignatureMethod. To access the signature method after the signature is generated, call the IOpcDigitalSignature::GetSignatureMethod method.

Important  A valid signature method must be set before the signature is generated by calling the IOpcDigitalSignatureManager::Sign method.
 
When a signature is generated it is serialized as signature markup. The signature method is used to calculate the value in the SignatureValue element in the signature markup.

When a signature is validated, the signature method is used to recalculate that value, and the recalculated value is compared to the value in the SignatureValue element in the signature markup.

Thread Safety

Packaging objects are not thread-safe.

For more information, see the Getting Started with the Packaging API.

Requirements

Requirement Value
Minimum supported client Windows 7 [desktop apps only]
Minimum supported server Windows Server 2008 R2 [desktop apps only]
Target Platform Windows
Header msopc.h

See also

Core Packaging Interfaces

Getting Started with the Packaging API

IOpcDigitalSignature

IOpcSigningOptions

Overviews

Packaging API Programming Guide

Packaging API Reference

Packaging API Samples

Packaging Digital Signature Interfaces

Packaging Interfaces

Reference