System.Security
2.0.0.0
4.0.0.0
System.Security.Cryptography.Xml.EncryptedReference
This class represents the <CipherReference> element in XML encryption. It identifies a source which, when processed, yields the encrypted data.
The actual encrypted data referenced by the <CipherReference> is obtained by the following process. The <CipherReference> URI property contains a Uniform Resource Identifier (URI) that is dereferenced. If the <CipherReference> element also contains a transform chain, the data resulting from dereferencing the URI is transformed as specified to produce the encrypted data. For example, if the encrypted data is base64-encoded within an XML document, the transforms would specify an XPath expression followed by a base64 decoding so the encrypted data can be extracted.
The syntax of the URI and transforms is similar to that of XML digital signatures. However, in XML digital signatures, both generation and validation processing start with the same source data and perform that transform in the same order. In XML encryption, the decrypting application has only the encrypted data and the specified transforms. The transforms are enumerated in the order necessary to obtain the encrypted data.
Note By default, you cannot dereference cipher references from documents with unknown sources, such as files from a Web site, because the property is null. For example, when you attempt to decrypt a file containing a <CipherReference> element that references a file on the Web, a is thrown, even if the request is made by a fully trusted assembly.
If you are sure the documents you are decrypting can be trusted, you can change this behavior for fully trusted applications by using the following code:
Evidence ev = new Evidence();
ev.AddHost (new Zone(SecurityZone.MyComputer));
EncryptedXml exml = new EncryptedXml(doc, ev);
Represents the <CipherReference> element in XML encryption. This class cannot be inherited.
Constructor
2.0.0.0
4.0.0.0
This constructor creates a object that provides reference information for a object.
Initializes a new instance of the class.
Constructor
2.0.0.0
4.0.0.0
This constructor creates a object using a Uniform Resource Identifier (URI) that points to the encrypted data. The object is then used to provide reference information for a object.
You can use a URI to designate an XML file containing encrypted data. For example:
String uri = "http://www.woodgrovebank.com/document.xml";
You can also use a partial URI to designate that only a portion of an XML document is to be encrypted. For example, assume that an XML document named document.xml contains two MyForm elements as shown in the following XML code example:
<MyForm Id='Form1'>
<! -- Form data here -->
</MyForm>
<MyForm Id='Form2'>
<! -- Form data here -->
</MyForm>
You can encrypt only the content in Form2 using a URI such as the following:
String uri = "http://www.woodgrovebank.com/document.xml#Form2";
Initializes a new instance of the class using the specified Uniform Resource Identifier (URI).
A Uniform Resource Identifier (URI) pointing to the encrypted data.
Constructor
2.0.0.0
4.0.0.0
To be added.
This constructor creates a object using a Uniform Resource Identifier (URI) and transform chain to indicate the encrypted data. The object is then used to provide reference information for a object.
Initializes a new instance of the class using the specified Uniform Resource Identifier (URI) and transform chain information.
A Uniform Resource Identifier (URI) pointing to the encrypted data.
Method
2.0.0.0
4.0.0.0
System.Xml.XmlElement
Use this method to output the <CipherReference> element in XML.
Returns the XML representation of a object.
An that represents the <CipherReference> element in XML encryption.
Method
2.0.0.0
4.0.0.0
System.Void
Use this method to load an existing XML element into the object.
Loads XML information into the <CipherReference> element in XML encryption.
An object that represents an XML element to use as the reference.