CipherReference.GetXml Método
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Retorna a representação XML de um objeto CipherReference.
public:
override System::Xml::XmlElement ^ GetXml();
public override System.Xml.XmlElement GetXml ();
override this.GetXml : unit -> System.Xml.XmlElement
Public Overrides Function GetXml () As XmlElement
Retornos
Um XmlElement que representa o elemento <CipherReference>
na criptografia XML.
Exceções
O valor CipherReference é null
.
Exemplos
O exemplo de código a seguir mostra uma maneira de usar o GetXml método .
#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
Comentários
Use esse método para gerar o <CipherReference>
elemento em XML.
Aplica-se a
Colaborar conosco no GitHub
A fonte deste conteúdo pode ser encontrada no GitHub, onde você também pode criar e revisar problemas e solicitações de pull. Para obter mais informações, confira o nosso guia para colaboradores.