IOpcSignatureReference interface (msopc.h)
Represents a reference to XML markup that has been or will be signed. This referenced XML markup is serialized in the signature markup when a signature is generated.
Inheritance
The IOpcSignatureReference interface inherits from the IUnknown interface. IOpcSignatureReference also has these types of members:
Methods
The IOpcSignatureReference interface has these methods.
IOpcSignatureReference::GetDigestMethod Gets the digest method to use on the referenced XML element, when the element is signed. |
IOpcSignatureReference::GetDigestValue Gets the digest value that is calculated for the referenced XML element when the element is signed. |
IOpcSignatureReference::GetId Gets the identifier for the reference. |
IOpcSignatureReference::GetTransformMethod Gets the canonicalization method to use on the referenced XML element, when the element is signed. |
IOpcSignatureReference::GetType Gets a string that indicates the type of the referenced XML element. |
IOpcSignatureReference::GetUri Gets the URI of the referenced XML element. |
Remarks
To create an IOpcSignatureReference interface pointer, call the IOpcSignatureReferenceSet::Create method. IOpcSignatureReferenceSet::Create does not create the reference to the package-specific Object element; that reference is created automatically when the signature is generated.
To access an IOpcSignatureReference interface pointer, call the IOpcSignatureReferenceEnumerator::GetCurrent method. IOpcSignatureReferenceEnumerator::GetCurrent does not access the reference to the package-specific Object element; call the IOpcDigitalSignature::GetPackageObjectReference method to access that reference.
The interface provides methods to access information about the reference itself, and referenced XML element. The referenced element can be the package-specific Object element, an application-specific Object element, or a child element of an application-specific Object.
When a signature is generated, this reference information is serialized in the XML markup of the signature (signature markup). In signature markup, the information is represented by a Reference element that has its URI attribute value set to "#" followed by the Id attribute value of the referenced element. For example, if the Id attribute of the referenced element is "Application" the URI attribute of the Reference element is set to "#Application" as shown in the following markup.
The following signature markup shows a serialized reference to a signed, application-specific Object element.
<Signature Id="SignatureId" xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
[...]
<Reference URI="#idPackageObject" ...>
[...]
</Reference>
<!-- This reference indicates that the application-specific
Object element was signed when the signature was generated.-->
<Reference URI="#Application" ...>
[...]
</Reference>
</SignedInfo>
[...]
<Object Id="idPackageObject" ...>
[...]
</Object>
<!-- This application-specific <Object> element was signed when the
signature was generated. -->
<Object Id="Application">
[...]
</Object>
</Signature>
The following signature markup shows a serialized reference to a signed, child element of an application-specific Object element.
<Signature Id="SignatureId" xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
[...]
<Reference URI="#idPackageObject" ...>
[...]
</Reference>
<!-- This reference indicates that MyElement in the application
-specific Object element was signed when the signature was
generated. -->
<Reference URI="#MyElementId" ...>
[...]
</Reference>
</SignedInfo>
[...]
<Object Id="idPackageObject" ...>
[...]
</Object>
<Object Id="Application">
[...]
<!-- This element is signed. -->
<MyElement Id="MyElementId">
[...]
</MyElement>
[...]
</Object>
</Signature>
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 7 [desktop apps | UWP apps] |
Minimum supported server | Windows Server 2008 R2 [desktop apps | UWP apps] |
Target Platform | Windows |
Header | msopc.h |
See also
Getting Started with the Packaging API
IOpcSignatureReferenceEnumerator
Overviews
Packaging API Programming Guide
Packaging Digital Signature Interfaces
Reference