IXpsSignatureManager::AddSignatureBlock method (xpsdigitalsignature.h)

Creates a new IXpsSignatureBlock interface and adds it to the signature block collection.

Syntax

HRESULT AddSignatureBlock(
  [in]          IOpcPartUri        *partName,
  [in]          UINT32             fixedDocumentIndex,
  [out, retval] IXpsSignatureBlock **signatureBlock
);

Parameters

[in] partName

A pointer to the IOpcPartUri interface that contains the URI of the new part. For the method to generate a part name, this parameter can be set to NULL.

[in] fixedDocumentIndex

The index value of the FixedDocument part with which the new signature block is to be associated.

[out, retval] signatureBlock

A pointer to the new IXpsSignatureBlock interface. If access to the new interface is not required, this parameter can be set to NULL.

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_INVALIDARG
fixedDocumentIndex references a fixed document that is not found in the XPS package.
XPS_E_PACKAGE_NOT_OPENED
An XPS package has not yet been opened in the signature manager.

Remarks

A signature block represents a SignatureDefinitions part in an XPS package. According to section 10.2.2 in the XML Paper Specification, zero or more SignatureDefinitions parts can be attached to each FixedDocument. This method creates a new SignatureDefinitions part with the specified name, links it from the specified FixedDocument part by a relationship, creates a new IXpsSignatureBlock interface, and adds this new interface to the internal signature block collection.

To retrieve a signature block, call the GetSignatureBlocks method.

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 xpsdigitalsignature.h

See also

IOpcPartUri

IXpsSignatureBlock

IXpsSignatureManager

XML Paper Specification

XPS Digital Signature API Errors

XPS Document Errors