语言

EncryptedReference 类

定义

表示 XML 加密 CipherReference中使用的抽象基类, KeyReference以及 DataReference 从中派生类。

public ref class EncryptedReference abstract
public abstract class EncryptedReference
type EncryptedReference = class
Public MustInherit Class EncryptedReference
继承
EncryptedReference
派生

示例

以下示例使用 GetXml 类中的 CipherReference 方法将 XML 值写入控制台。

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, TransformChain)

使用指定的统一资源标识符(URI)和转换链初始化类的新实例 EncryptedReference 。

EncryptedReference(String)

使用指定的统一资源标识符(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)

适用于