Partager via


IXpsSignatureManager interface

Manages the digital signatures and digital signature requests of an XPS document.

When to implement

Never. Custom implementation of this interface is not supported.

Members

The IXpsSignatureManager interface inherits from the IUnknown interface. IXpsSignatureManager also has these types of members:

  • Methods

Methods

The IXpsSignatureManager interface has these methods.

Method Description
AddSignatureBlock

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

CreateSigningOptions

Creates a new IXpsSigningOptions interface.

GetSignatureBlocks

Gets a pointer to an IXpsSignatureBlockCollection interface that contains a collection of signature blocks.

GetSignatureOriginPartName

Gets the part name of the signature origin part.

GetSignatures

Gets a pointer to an IXpsSignatureCollection interface that contains a collection of XPS digital signatures.

LoadPackageFile

Loads an existing XPS package from a file into the digital signature manager.

LoadPackageStream

Loads an XPS package from a stream into the digital signature manager.

SavePackageToFile

Saves the XPS package to a file.

SavePackageToStream

Saves the XPS package by writing it to a stream.

SetSignatureOriginPartName

Sets the part name of the signature origin part.

Sign

Signs the contents of an XPS package as specified by the signing options and returns the resulting digital signature.

 

Remarks

To initialize the signature manager for use with an XPS document, instantiate an IXpsSignatureManager interface by calling CoCreateInstance as shown in the following example.

IXpsSignatureManager    *newInterface;

// Note the implicit requirement that CoInitializeEx 
//  has previously been called from this thread.

hr = CoCreateInstance(
    __uuidof(XpsSignatureManager),
    NULL, 
    CLSCTX_INPROC_SERVER,
    __uuidof(IXpsSignatureManager),
    reinterpret_cast<LPVOID*>(&newInterface));

// make sure that you got a pointer 
// to the interface
if (SUCCEEDED(hr)) {
    // Load document into signature manager from file.
    //  xpsDocument is initialized with the file name
    //  of the document to load outside of this example.
    hr = newInterface->LoadPackageFile (xpsDocument);

    // Use newInterface

    // Release interface pointers when finished with them 
    newInterface->Release();
}    

The interface instantiated by CoCreateInstance can be used by only one XPS document, which must be loaded by calling LoadPackageFile or LoadPackageStream before calling any other method.

After the IXpsSignatureManager interface has been instantiated and an XPS document has been loaded, the signature manager is ready for use.

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

Interfaces

CoCreateInstance

XML Paper Specification