共用方式為


IOpcSignatureReference 介面 (msopc.h)

表示已簽署或即將簽署之 XML 標記的參考。 產生簽章時,這個參考的 XML 標記會在簽章標記中序列化。

繼承

IOpcSignatureReference介面繼承自IUnknown介面。 IOpcSignatureReference 也有下列類型的成員:

方法

IOpcSignatureReference介面具有這些方法。

 
IOpcSignatureReference::GetDigestMethod

取得簽署專案時,要用於所參考 XML 元素的摘要方法。
IOpcSignatureReference::GetDigestValue

取得摘要值,這個值會在專案帶正負號時,針對參考的 XML 專案計算。
IOpcSignatureReference::GetId

取得參考的識別碼。
IOpcSignatureReference::GetTransformMethod

取得簽署專案時,要用於參考之 XML 元素上的標準化方法。
IOpcSignatureReference::GetType

取得字串,這個字串表示所參考 XML 專案的型別。
IOpcSignatureReference::GetUri

取得所參考 XML 專案的 URI。

備註

若要建立 IOpcSignatureReference 介面指標,請呼叫 IOpcSignatureReferenceSet::Create 方法。 IOpcSignatureReferenceSet::Create 不會建立封裝特定 Object 元素的參考;產生簽章時會自動建立該參考。

若要存取 IOpcSignatureReference 介面指標,請呼叫 IOpcSignatureReferenceEnumerator::GetCurrent 方法。 IOpcSignatureReferenceEnumerator::GetCurrent 不會存取套件特定 Object 元素的參考;呼叫 IOpcDigitalSignature::GetPackageObjectReference 方法來存取該參考。

介面提供方法來存取參考本身的相關資訊,以及參考的 XML 專案。 參考的專案可以是封裝特定的 Object 元素、應用程式特定的 Object 元素,或應用程式特定 物件的子專案。

產生簽章時,此參考資訊會在簽章的 XML 標記中序列化, (簽章標記) 。 在簽章標記中,資訊是由 Reference 元素表示,其 URI 屬性值設定為 「#」,後面接著參考專案的 Id 屬性值。 例如,如果參考專案的Id屬性是 「Application」,則 Reference元素的URI屬性會設定為 「#Application」,如下列標記所示。

下列簽章標記顯示已簽署、應用程式特定 Object 元素的序列化參考。

<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>

下列簽章標記顯示應用程式特定 Object 元素之帶正負號之子專案的序列化參考。

注意 可以參考應用程式特定 Object 的多個子項目進行簽署。

 
<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>

需求

   
最低支援的用戶端 Windows 7 [傳統型應用程式 |UWP 應用程式]
最低支援的伺服器 Windows Server 2008 R2 [傳統型應用程式 |UWP 應用程式]
目標平台 Windows
標頭 msopc.h

另請參閱

核心封裝介面

數位簽章概觀

使用封裝 API 消費者入門

IOpcDigitalSignature

IOpcSignatureReferenceEnumerator

IOpcSignatureReferenceSet

OPC_CANONICALIZATION_METHOD

概觀

封裝 API 程式設計指南

封裝 API 參考

封裝 API 範例

封裝數位簽章介面

封裝介面

參考