共用方式為


EncryptedReference 類別

定義

表示 XML 加密所使用的抽象基底類別,CipherReferenceKeyReferenceDataReference 等類別均從該處衍生。

public ref class EncryptedReference abstract
public abstract class EncryptedReference
type EncryptedReference = class
Public MustInherit Class EncryptedReference
繼承
EncryptedReference
衍生

範例

下列範例會 GetXml 使用 類別中的 CipherReference 方法,將 XML 值寫入主控台。

#using <System.Xml.dll>
#using <System.Security.dll>
#using <System.dll>

using namespace System;
using namespace System::Security::Cryptography::Xml;
using namespace System::Xml;
using namespace System::IO;

/// This sample used the GetXml method in the CipherReference class to 
/// write the XML values for the CipherReference to the console.

[STAThread]
int main()
{
   
   //Create a URI string.
   String^ uri = "http://www.woodgrovebank.com/document.xml";
   
   // Create a Base64 transform. The input content retrieved from the
   // URI should be Base64-decoded before other processing.
   Transform^ base64 = gcnew XmlDsigBase64Transform;
   
   //Create a transform chain and add the transform to it.
   TransformChain^ tc = gcnew TransformChain;
   tc->Add( base64 );
   
   //Create <CipherReference> information.
   CipherReference ^ reference = gcnew CipherReference( uri,tc );
   
   // Write the CipherReference value to the console.
   Console::WriteLine( "Cipher Reference data: {0}", reference->GetXml()->OuterXml );
}
using System;
using System.Security.Cryptography.Xml;
using System.Xml;
using System.IO;

/// This sample used the GetXml method in the CipherReference class to
/// write the XML values for the CipherReference to the console.
namespace CipherReference2
{
    class CipherReference2
    {
        [STAThread]
        static void Main(string[] args)
        {
            //Create a URI string.
            String uri = "http://www.woodgrovebank.com/document.xml";

            // Create a Base64 transform. The input content retrieved from the
            // URI should be Base64-decoded before other processing.
            Transform base64 = new XmlDsigBase64Transform();

            //Create a transform chain and add the transform to it.
            TransformChain tc = new TransformChain();

            tc.Add(base64);

            //Create <CipherReference> information.
            CipherReference reference = new CipherReference(uri, tc);
            // Write the CipherReference value to the console.
            Console.WriteLine("Cipher Reference data: {0}", reference.GetXml().OuterXml);
        }
    }
}
Imports System.Security.Cryptography.Xml
Imports System.Xml
Imports System.IO


' This sample used the GetXml method in the CipherReference class
' to write the value of CipherReference to the console.
Module Module1

    Sub Main()
        ' Create a URI string.
        Dim uri As String = "http://www.woodgrovebank.com/document.xml"
        ' Create a Base64 transform. The input content retrieved from the
        ' URI should be Base64-decoded before other processing.
        Dim base64 As Transform = New XmlDsigBase64Transform
        Dim tc As New TransformChain
        tc.Add(base64)
        ' Create <CipherReference> information.
        Dim reference As CipherReference = New CipherReference(uri, tc)
    ' Write the XML for the CipherReference to the console.
    Console.WriteLine("Cipher Reference: {0}", reference.GetXml().OuterXml)
    End Sub

End Module

備註

如需 XML 加密標準的詳細資訊,請參閱 XML 加密需求

建構函式

EncryptedReference()

初始化 EncryptedReference 類別的新執行個體。

EncryptedReference(String)

利用指定的統一資源識別元 (URI),初始化 EncryptedReference 類別的新執行個體。

EncryptedReference(String, TransformChain)

使用指定的統一資源識別元 (URI) 和轉換鏈結,初始化 EncryptedReference 類別的新執行個體。

屬性

CacheValid

取得值,指出快取是否有效。

ReferenceType

取得或設定參考型別。

TransformChain

取得或設定 EncryptedReference 物件的轉換鏈結。

Uri

取得或設定 EncryptedReference 物件的統一資源識別元 (URI)。

方法

AddTransform(Transform)

新增 Transform 物件至 EncryptedReference 物件的目前轉換鏈結。

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
GetXml()

傳回 EncryptedReference 物件的 XML 表示。

LoadXml(XmlElement)

將 XML 項目載入 EncryptedReference 物件中。

MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

適用於