IOpcSignaturePartReferenceSet::Create method

Creates an IOpcSignaturePartReference interface pointer that represents a reference to a part to be signed, and adds the new interface to the set.

Syntax


HRESULT Create(
  [in]          IOpcPartUri                 *partUri,
  [in]          LPCWSTR                     digestMethod,
  [in]          OPC_CANONICALIZATION_METHOD transformMethod,
  [out, retval] IOpcSignaturePartReference  **partReference
);

Parameters

partUri [in]

An IOpcPartUri that represents the part name of the part to be referenced.

digestMethod [in]

The digest method to be used for part content of the part to be referenced. To use the default digest method, pass NULL to this parameter.

Important  The default digest method must be set by calling the IOpcSigningOptions::SetDefaultDigestMethod method before IOpcDigitalSignatureManager::Sign is called.
 
transformMethod [in]

The canonicalization method used for part content of the part to be referenced.

partReference [out, retval]

A new IOpcSignaturePartReference interface pointer that represents the reference to the part to be signed.

This parameter can be NULL if a pointer to the new interface is not needed.

Return value

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

Return codeDescription
S_OK

The method succeeded.

E_INVALIDARG

The value passed in the transformMethod parameter is not a valid OPC_CANONICALIZATION_METHOD enumeration value.

E_POINTER

The partUri parameter is NULL.

 

Remarks

Only parts that can be represented by the IOpcPart interface can be referenced by an IOpcSignaturePartReference interface pointer. Relationships parts are referenced for signing by a pointer to the IOpcSignatureRelationshipReference interface. To create an IOpcSignatureRelationshipReference interface pointer, call the IOpcSignatureRelationshipReferenceSet::Create method.

When an IOpcSignaturePartReference interface pointer is created and added to the set, the reference it represents is saved when the package is saved.

Thread Safety

Packaging objects are not thread-safe.

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

Requirements

Minimum supported client

Windows 7 [desktop apps only]

Minimum supported server

Windows Server 2008 R2 [desktop apps only]

Header

Msopc.h

IDL

OpcDigitalSignature.idl

See also

IOpcSignaturePartReferenceSet
Overviews
Getting Started with the Packaging API
Packaging API Programming Guide
Reference
IOpcDigitalSignatureManager
IOpcSignatureRelationshipReferenceSet
IOpcSigningOptions
OPC_CANONICALIZATION_METHOD
Core Packaging Interfaces
Packaging Digital Signature Interfaces
Packaging Interfaces
Packaging API Reference
Packaging API Samples

 

 

Community Additions

ADD
Show: