IOpcFactory::CreateDigitalSignatureManager method (msopc.h)

Creates a digital signature manager object for a package object.

Syntax

HRESULT CreateDigitalSignatureManager(
  [in]          IOpcPackage                 *package,
  [out, retval] IOpcDigitalSignatureManager **signatureManager
);

Parameters

[in] package

A pointer to the IOpcPackage interface of the package object to associate with the digital signature manager object.

[out, retval] signatureManager

A pointer to the IOpcDigitalSignatureManager interface of the digital signature manager object that is created for use with the package object.

A digital signature manager object provides access to the Packaging API's digital signature interfaces and methods. These can be used to sign the package represented by the package object or to validate the signatures in a package that has already been signed.

Return value

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

Return code/value Description
S_OK
The method succeeded.
E_NOTIMPL
This method is not implemented for this version of Windows.
OPC_E_DS_DUPLICATE_SIGNATURE_ORIGIN_RELATIONSHIP
0x8051001B
More than one relationship of the digital signature origin relationship type exists, but only one such relationship is allowed.

For more information about this relationship type, see the OPC.

OPC_E_DS_INVALID_SIGNATURE_ORIGIN_RELATIONSHIP
0x8051001C
A package relationship of type digital signature origin is targeting a location that is external to the package. Digital Signature Origin parts must be located internally.

For more information about this relationship type, see the OPC.

OPC_E_DS_MISSING_SIGNATURE_ORIGIN_PART
0x8051001F
A relationship of type digital signature origin was found, but the Digital Signature Origin part itself was not.

For more information about this relationship type, see the OPC.

Remarks

If a package is modified while Packaging Digital Signature Interfaces are being used to sign the package, signing may fail or result in an inconsistent signature or package.

Support on Previous Versions of Windows

This method is not supported on versions of Windows prior to Windows 7. For more information, see Getting Started with the Packaging API, and Platform Update for Windows Vista.

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

Digital Signatures Overview

ECMA-376 OpenXML

External Resources

Getting Started with the Packaging API

IOpcFactory

Music Bundle Signature Sample

Overviews

Packaging API Programming Guide

Packaging API Reference

Packaging API Samples

Packaging Errors

Platform Update for Windows Vista

Reference