XmlDsigXPathTransform クラス
アセンブリ: System.Security (system.security.dll 内)


XmlDsigXPathTransform クラスを使用すると、XPath 言語を使用して XML ドキュメントを操作できます。このクラスは、署名または暗号化の対象とする XML ノードを、XPath 式を使って選択することにより、それ以外のノードを暗号操作から除外します。
XML ドキュメントの特定の部分を XPath 式で選択して署名または暗号化するには、XmlDsigXPathTransform クラスを使用します。XmlDsigXPathTransform クラスを XPath 変換文字列の値に初期化する方法については、LoadInnerXml メソッドのトピックを参照してください。
XmlDsigXPathTransform クラスを識別する URI (Uniform Resource Identifier) は、XmlDsigXPathTransformUrl フィールドによって定義されます。
XPath 変換の詳細については、www.w3.org/TR/xmldsig-core/ の W3C から提供されている XMLDSIG 仕様のセクション 6.6.3 を参照してください。

このセクションには、2 つのコード例が含まれています。1 つ目のコードには、エンベロープ シグネチャで XmlDsigXPathTransform クラスを使用し、XML ドキュメントの署名および検証を行う例が示されています。この例では、XML ドキュメントに署名し、その署名を新しい XML ドキュメントに保存しています。2 つ目のコードには、XmlDsigXPathTransform クラスのメンバを呼び出す例が示されています。
' ' This example signs an XML file using an ' envelope signature. It then verifies the ' signed XML. ' Imports System Imports System.Security.Cryptography Imports System.Security.Cryptography.X509Certificates Imports System.Security.Cryptography.Xml Imports System.Text Imports System.Xml Module SignVerifyEnvelope Sub Main(ByVal args() As String) ' Generate a signing key. Dim Key As New RSACryptoServiceProvider() Try ' Create an XML file to sign. CreateSomeXml("Example.xml") Console.WriteLine("New XML file created.") ' Sign the XML that was just created and save it in a ' new file. SignXmlFile("Example.xml", "SignedExample.xml", Key, "ancestor-or-self::TempElement") Console.WriteLine("XML file signed.") ' Verify the signature of the signed XML. Console.WriteLine("Verifying signature...") Dim result As Boolean = VerifyXmlFile("SignedExample.xml") ' Display the results of the signature verification to \ ' the console. If result Then Console.WriteLine("The XML signature is valid.") Else Console.WriteLine("The XML signature is not valid.") End If Catch e As CryptographicException Console.WriteLine(e.Message) Finally Key.Clear() End Try End Sub ' Sign an XML file and save the signature in a new file. Sub SignXmlFile(ByVal FileName As String, ByVal SignedFileName As String, ByVal Key As RSA, ByVal XPathString As String) ' Create a new XML document. Dim doc As New XmlDocument() ' Format the document to ignore white spaces. doc.PreserveWhitespace = False ' Load the passed XML file using it's name. doc.Load(New XmlTextReader(FileName)) ' Create a SignedXml object. Dim signedXml As New SignedXml(doc) ' Add the key to the SignedXml document. signedXml.SigningKey = Key ' Create a reference to be signed. Dim reference As New Reference() reference.Uri = "" ' Create an XmlDsigXPathTransform object using ' the helper method 'CreateXPathTransform' defined ' later in this sample. Dim XPathTransform As XmlDsigXPathTransform = CreateXPathTransform(XPathString) ' Add the transform to the reference. reference.AddTransform(XPathTransform) ' Add the reference to the SignedXml object. signedXml.AddReference(reference) ' Add an RSAKeyValue KeyInfo (optional; helps recipient find key to validate). Dim keyInfo As New KeyInfo() keyInfo.AddClause(New RSAKeyValue(CType(Key, RSA))) signedXml.KeyInfo = keyInfo ' Compute the signature. signedXml.ComputeSignature() ' Get the XML representation of the signature and save ' it to an XmlElement object. Dim xmlDigitalSignature As XmlElement = signedXml.GetXml() ' Append the element to the XML document. doc.DocumentElement.AppendChild(doc.ImportNode(xmlDigitalSignature, True)) ' Save the signed XML document to a file specified ' using the passed string. Dim xmltw As New XmlTextWriter(SignedFileName, New UTF8Encoding(False)) doc.WriteTo(xmltw) xmltw.Close() End Sub ' Verify the signature of an XML file and return the result. Function VerifyXmlFile(ByVal Name As String) As [Boolean] ' Create a new XML document. Dim xmlDocument As New XmlDocument() ' Format using white spaces. xmlDocument.PreserveWhitespace = True ' Load the passed XML file into the document. xmlDocument.Load(Name) ' Create a new SignedXml object and pass it ' the XML document class. Dim signedXml As New SignedXml(xmlDocument) ' Find the "Signature" node and create a new ' XmlNodeList object. Dim nodeList As XmlNodeList = xmlDocument.GetElementsByTagName("Signature") ' Load the signature node. signedXml.LoadXml(CType(nodeList(0), XmlElement)) ' Check the signature and return the result. Return signedXml.CheckSignature() End Function ' Create the XML that represents the transform. Function CreateXPathTransform(ByVal XPathString As String) As XmlDsigXPathTransform ' Create a new XMLDocument object. Dim doc As New XmlDocument() ' Create a new XmlElement. Dim xPathElem As XmlElement = doc.CreateElement("XPath") ' Set the element text to the value ' of the XPath string. xPathElem.InnerText = XPathString ' Create a new XmlDsigXPathTransform object. Dim xForm As New XmlDsigXPathTransform() ' Load the XPath XML from the element. xForm.LoadInnerXml(xPathElem.SelectNodes(".")) ' Return the XML that represents the transform. Return xForm End Function ' Create example data to sign. Sub CreateSomeXml(ByVal FileName As String) ' Create a new XmlDocument object. Dim document As New XmlDocument() ' Create a new XmlNode object. Dim node As XmlNode = document.CreateNode(XmlNodeType.Element, "", "MyXML", "Don't_Sign") ' Append the node to the document. document.AppendChild(node) ' Create a new XmlNode object. Dim subnode As XmlNode = document.CreateNode(XmlNodeType.Element, "", "TempElement", "Sign") ' Add some text to the node. subnode.InnerText = "Here is some data to sign." ' Append the node to the document. document.DocumentElement.AppendChild(subnode) ' Save the XML document to the file name specified. Dim xmltw As New XmlTextWriter(FileName, New UTF8Encoding(False)) document.WriteTo(xmltw) xmltw.Close() End Sub End Module
// // This example signs an XML file using an // envelope signature. It then verifies the // signed XML. // using System; using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; using System.Security.Cryptography.Xml; using System.Text; using System.Xml; public class SignVerifyEnvelope { public static void Main(String[] args) { // Generate a signing key. RSACryptoServiceProvider Key = new RSACryptoServiceProvider(); try { // Create an XML file to sign. CreateSomeXml("Example.xml"); Console.WriteLine("New XML file created."); // Sign the XML that was just created and save it in a // new file. SignXmlFile("Example.xml", "SignedExample.xml", Key, "ancestor-or-self::TempElement"); Console.WriteLine("XML file signed."); // Verify the signature of the signed XML. Console.WriteLine("Verifying signature..."); bool result = VerifyXmlFile("SignedExample.xml"); // Display the results of the signature verification to \ // the console. if (result) { Console.WriteLine("The XML signature is valid."); } else { Console.WriteLine("The XML signature is not valid."); } } catch (CryptographicException e) { Console.WriteLine(e.Message); } finally { Key.Clear(); } } // Sign an XML file and save the signature in a new file. public static void SignXmlFile(string FileName, string SignedFileName, RSA Key, string XPathString) { // Create a new XML document. XmlDocument doc = new XmlDocument(); // Format the document to ignore white spaces. doc.PreserveWhitespace = false; // Load the passed XML file using it's name. doc.Load(new XmlTextReader(FileName)); // Create a SignedXml object. SignedXml signedXml = new SignedXml(doc); // Add the key to the SignedXml document. signedXml.SigningKey = Key; // Create a reference to be signed. Reference reference = new Reference(); reference.Uri = ""; // Create an XmlDsigXPathTransform object using // the helper method 'CreateXPathTransform' defined // later in this sample. XmlDsigXPathTransform XPathTransform = CreateXPathTransform(XPathString); // Add the transform to the reference. reference.AddTransform(XPathTransform); // Add the reference to the SignedXml object. signedXml.AddReference(reference); // Add an RSAKeyValue KeyInfo (optional; helps recipient find key to validate). KeyInfo keyInfo = new KeyInfo(); keyInfo.AddClause(new RSAKeyValue((RSA)Key)); signedXml.KeyInfo = keyInfo; // Compute the signature. signedXml.ComputeSignature(); // Get the XML representation of the signature and save // it to an XmlElement object. XmlElement xmlDigitalSignature = signedXml.GetXml(); // Append the element to the XML document. doc.DocumentElement.AppendChild(doc.ImportNode(xmlDigitalSignature, true)); // Save the signed XML document to a file specified // using the passed string. XmlTextWriter xmltw = new XmlTextWriter(SignedFileName, new UTF8Encoding(false)); doc.WriteTo(xmltw); xmltw.Close(); } // Verify the signature of an XML file and return the result. public static Boolean VerifyXmlFile(String Name) { // Create a new XML document. XmlDocument xmlDocument = new XmlDocument(); // Format using white spaces. xmlDocument.PreserveWhitespace = true; // Load the passed XML file into the document. xmlDocument.Load(Name); // Create a new SignedXml object and pass it // the XML document class. SignedXml signedXml = new SignedXml(xmlDocument); // Find the "Signature" node and create a new // XmlNodeList object. XmlNodeList nodeList = xmlDocument.GetElementsByTagName("Signature"); // Load the signature node. signedXml.LoadXml((XmlElement)nodeList[0]); // Check the signature and return the result. return signedXml.CheckSignature(); } // Create the XML that represents the transform. private static XmlDsigXPathTransform CreateXPathTransform(string XPathString) { // Create a new XMLDocument object. XmlDocument doc = new XmlDocument(); // Create a new XmlElement. XmlElement xPathElem = doc.CreateElement("XPath"); // Set the element text to the value // of the XPath string. xPathElem.InnerText = XPathString; // Create a new XmlDsigXPathTransform object. XmlDsigXPathTransform xForm = new XmlDsigXPathTransform(); // Load the XPath XML from the element. xForm.LoadInnerXml(xPathElem.SelectNodes(".")); // Return the XML that represents the transform. return xForm; } // Create example data to sign. public static void CreateSomeXml(string FileName) { // Create a new XmlDocument object. XmlDocument document = new XmlDocument(); // Create a new XmlNode object. XmlNode node = document.CreateNode(XmlNodeType.Element, "", "MyXML", "Don't_Sign"); // Append the node to the document. document.AppendChild(node); // Create a new XmlNode object. XmlNode subnode = document.CreateNode(XmlNodeType.Element, "", "TempElement", "Sign"); // Add some text to the node. subnode.InnerText = "Here is some data to sign."; // Append the node to the document. document.DocumentElement.AppendChild(subnode); // Save the XML document to the file name specified. XmlTextWriter xmltw = new XmlTextWriter(FileName, new UTF8Encoding(false)); document.WriteTo(xmltw); xmltw.Close(); } }
// // This example signs an XML file using an // envelope signature. It then verifies the // signed XML. // #using <System.Xml.dll> #using <System.Security.dll> #using <System.dll> using namespace System; using namespace System::Security::Cryptography; using namespace System::Security::Cryptography::X509Certificates; using namespace System::Security::Cryptography::Xml; using namespace System::Text; using namespace System::Xml; // Create the XML that represents the transform. static XmlDsigXPathTransform^ CreateXPathTransform( String^ XPathString ) { // Create a new XMLDocument object. XmlDocument^ doc = gcnew XmlDocument; // Create a new XmlElement. XmlElement^ xPathElem = doc->CreateElement( L"XPath" ); // Set the element text to the value // of the XPath string. xPathElem->InnerText = XPathString; // Create a new XmlDsigXPathTransform object. XmlDsigXPathTransform^ xForm = gcnew XmlDsigXPathTransform; // Load the XPath XML from the element. xForm->LoadInnerXml( xPathElem->SelectNodes( L"." ) ); // Return the XML that represents the transform. return xForm; } // Sign an XML file and save the signature in a new file. static void SignXmlFile( String^ FileName, String^ SignedFileName, RSA^ Key, String^ XPathString ) { // Create a new XML document. XmlDocument^ doc = gcnew XmlDocument; // Format the document to ignore white spaces. doc->PreserveWhitespace = false; // Load the passed XML file using it's name. doc->Load( gcnew XmlTextReader( FileName ) ); // Create a SignedXml object. SignedXml^ signedXml = gcnew SignedXml( doc ); // Add the key to the SignedXml document. signedXml->SigningKey = Key; // Create a reference to be signed. Reference^ reference = gcnew Reference; reference->Uri = L""; // Create an XmlDsigXPathTransform object using // the helper method 'CreateXPathTransform' defined // later in this sample. XmlDsigXPathTransform^ XPathTransform = CreateXPathTransform( XPathString ); // Add the transform to the reference. reference->AddTransform( XPathTransform ); // Add the reference to the SignedXml object. signedXml->AddReference( reference ); // Add an RSAKeyValue KeyInfo (optional; helps recipient find key to validate). KeyInfo^ keyInfo = gcnew KeyInfo; keyInfo->AddClause( gcnew RSAKeyValue( dynamic_cast<RSA^>(Key) ) ); signedXml->KeyInfo = keyInfo; // Compute the signature. signedXml->ComputeSignature(); // Get the XML representation of the signature and save // it to an XmlElement object. XmlElement^ xmlDigitalSignature = signedXml->GetXml(); // Append the element to the XML document. doc->DocumentElement->AppendChild( doc->ImportNode( xmlDigitalSignature, true ) ); // Save the signed XML document to a file specified // using the passed string. XmlTextWriter^ xmltw = gcnew XmlTextWriter( SignedFileName,gcnew UTF8Encoding( false ) ); doc->WriteTo( xmltw ); xmltw->Close(); } // Verify the signature of an XML file and return the result. static Boolean VerifyXmlFile( String^ Name ) { // Create a new XML document. XmlDocument^ xmlDocument = gcnew XmlDocument; // Format using white spaces. xmlDocument->PreserveWhitespace = true; // Load the passed XML file into the document. xmlDocument->Load( Name ); // Create a new SignedXml object and pass it // the XML document class. SignedXml^ signedXml = gcnew SignedXml( xmlDocument ); // Find the "Signature" node and create a new // XmlNodeList object. XmlNodeList^ nodeList = xmlDocument->GetElementsByTagName( L"Signature" ); // Load the signature node. signedXml->LoadXml( dynamic_cast<XmlElement^>(nodeList->Item( 0 )) ); // Check the signature and return the result. return signedXml->CheckSignature(); } // Create example data to sign. static void CreateSomeXml( String^ FileName ) { // Create a new XmlDocument object. XmlDocument^ document = gcnew XmlDocument; // Create a new XmlNode object. XmlNode^ node = document->CreateNode( XmlNodeType::Element, L"", L"MyXML", L"Don't_Sign" ); // Append the node to the document. document->AppendChild( node ); // Create a new XmlNode object. XmlNode^ subnode = document->CreateNode( XmlNodeType::Element, L"", L"TempElement", L"Sign" ); // Add some text to the node. subnode->InnerText = L"Here is some data to sign."; // Append the node to the document. document->DocumentElement->AppendChild( subnode ); // Save the XML document to the file name specified. XmlTextWriter^ xmltw = gcnew XmlTextWriter( FileName,gcnew UTF8Encoding( false ) ); document->WriteTo( xmltw ); xmltw->Close(); } int main() { // Generate a signing key. RSACryptoServiceProvider^ Key = gcnew RSACryptoServiceProvider; try { // Create an XML file to sign. CreateSomeXml( L"Example.xml" ); Console::WriteLine( L"New XML file created." ); // Sign the XML that was just created and save it in a // new file. SignXmlFile( L"Example.xml", L"SignedExample.xml", Key, L"ancestor-or-self::TempElement" ); Console::WriteLine( L"XML file signed." ); // Verify the signature of the signed XML. Console::WriteLine( L"Verifying signature..." ); bool result = VerifyXmlFile( L"SignedExample.xml" ); // Display the results of the signature verification to \ // the console. if ( result ) { Console::WriteLine( L"The XML signature is valid." ); } else { Console::WriteLine( L"The XML signature is not valid." ); } } catch ( CryptographicException^ e ) { Console::WriteLine( e->Message ); } finally { Key->Clear(); } return 1; }
Imports System Imports System.IO Imports System.Xml Imports System.Security.Cryptography Imports System.Security.Cryptography.Xml Class Class1 <STAThread()> _ Shared Sub Main(ByVal args() As String) ' Encrypt a sample XML string. Dim productsXml As XmlDocument = LoadProducts() ShowTransformProperties(productsXml) ' Encrypt an XPath Xml string. Dim transformXml As XmlDocument = LoadTransformByXml() ShowTransformProperties(transformXml) ' Use XmlDsigXPathTransform to resolve a Uri. Dim baseUri As New Uri("http://www.contoso.com") Dim relativeUri As String = "xml" Dim absoluteUri As Uri = ResolveUris(baseUri, relativeUri) Console.WriteLine("This sample completed successfully; " + "press Enter to exit.") Console.ReadLine() End Sub 'Main ' Encrypt the text in the specified XmlDocument. Private Shared Sub ShowTransformProperties(ByVal xmlDoc As XmlDocument) ' Create a new XMLDocument object. Dim doc As New XmlDocument() ' Create a new XmlElement. Dim xPathElem As XmlElement = doc.CreateElement("XPath") ' Set the element text to the value ' of the XPath string. xPathElem.InnerText = "ancestor-or-self::PRODUCTS" ' Create a new XmlDsigXPathTransform object. Dim xmlTransform As New XmlDsigXPathTransform() ' Load the XPath XML from the element. xmlTransform.LoadInnerXml(xPathElem.SelectNodes(".")) ' Ensure the transform is using the proper algorithm. xmlTransform.Algorithm = SignedXml.XmlDsigXPathTransformUrl ' Retrieve the XML representation of the current transform. Dim xmlInTransform As XmlElement = xmlTransform.GetXml() Console.WriteLine(vbLf + "Xml representation of the current transform: ") Console.WriteLine(xmlInTransform.OuterXml) ' Retrieve the valid input types for the current transform. Dim validInTypes As Type() = xmlTransform.InputTypes ' Verify the xmlTransform can accept the XMLDocument as an ' input type. Dim i As Integer For i = 0 To validInTypes.Length If validInTypes(i).Equals(xmlDoc.GetType()) Then ' Load the document into the transfrom. xmlTransform.LoadInput(xmlDoc) Try ' This transform is created for demonstration purposes. Dim secondTransform As New XmlDsigXPathTransform() Dim classDescription As String = secondTransform.ToString() xmlTransform.LoadInnerXml(xPathElem.SelectNodes(".")) Catch Console.WriteLine("Caught exception while trying to " + "load the specified Xml document. The document " + "requires an XPath element to be valid.") End Try Exit For End If Next i Dim validOutTypes As Type() = xmlTransform.OutputTypes For i = validOutTypes.Length - 1 To 0 Step -1 If validOutTypes(i).Equals(GetType(System.Xml.XmlDocument)) Then Try Dim xmlDocumentType As Type = GetType(System.Xml.XmlDocument) Dim xmlDocumentOutput As XmlDocument = CType(xmlTransform.GetOutput(xmlDocumentType), XmlDocument) ' Display to the console the Xml before and after ' encryption. Console.WriteLine("Result of the GetOutput method call" + " from the current transform: " + xmlDocumentOutput.OuterXml) Catch ex As Exception Console.WriteLine("Unexpected exception caught: " + ex.ToString()) End Try Exit For ElseIf validOutTypes(i).Equals(GetType(System.Xml.XmlNodeList)) Then Try Dim xmlNodeListType As Type = GetType(System.Xml.XmlNodeList) Dim xmlNodes As XmlNodeList = CType(xmlTransform.GetOutput(xmlNodeListType), XmlNodeList) ' Display to the console the Xml before and after ' encryption. Console.WriteLine("Encoding the following message: " + xmlDoc.InnerText) Console.WriteLine("Nodes of the XmlNodeList retrieved " + "from GetOutput:") Dim j As Integer For j = 0 To xmlNodes.Count Console.WriteLine("Node " + j + " has the following name: " + xmlNodes.Item(j).Name + " and the following InnerXml: " + xmlNodes.Item(j).InnerXml) Next j Catch ex As Exception Console.WriteLine("Unexpected exception caught: " + ex.ToString()) End Try Exit For Else Dim outputObject As Object = xmlTransform.GetOutput() Next i End Sub 'ShowTransformProperties ' Create an XML document for the dsig namespace. Private Shared Function LoadTransformByXml() As XmlDocument Dim xmlDoc As New XmlDocument() Dim transformXml As String = "<Signature><Reference URI=''><Transforms>" transformXml += "<Transform><XPath " transformXml += "xmlns:dsig='http://www.w3.org/2000/09/xmldsig#'>" transformXml += "not(ancestor-or-self::dsig:Signature)" transformXml += "</XPath></Transform>" transformXml += "</Transforms></Reference></Signature>" xmlDoc.LoadXml(transformXml) Return xmlDoc End Function 'LoadTransformByXml ' Create an XML document describing various products. Private Shared Function LoadProducts() As XmlDocument Dim xmlDoc As New XmlDocument() Dim contosoProducts As String = "<PRODUCTS>" contosoProducts += "<PRODUCT><ID>123</ID>" contosoProducts += "<DESCRIPTION>Router</DESCRIPTION></PRODUCT>" contosoProducts += "<PRODUCT><ID>456</ID>" contosoProducts += "<DESCRIPTION>Keyboard</DESCRIPTION></PRODUCT>" contosoProducts += "<PRODUCT><ID>789</ID>" contosoProducts += "<DESCRIPTION>Monitor</DESCRIPTION></PRODUCT>" contosoProducts += "</PRODUCTS>" xmlDoc.LoadXml(contosoProducts) Return xmlDoc End Function 'LoadProducts ' Resolve the specified base and relative Uri's . Private Shared Function ResolveUris(ByVal baseUri As Uri, ByVal relativeUri As String) As Uri Dim xmlResolver As New XmlUrlResolver() xmlResolver.Credentials = System.Net.CredentialCache.DefaultCredentials Dim xmlTransform As New XmlDsigXPathTransform() xmlTransform.Resolver = xmlResolver Dim absoluteUri As Uri = xmlResolver.ResolveUri(baseUri, relativeUri) If Not (absoluteUri Is Nothing) Then Console.WriteLine(vbLf + "Resolved the base Uri and relative Uri to the following:") Console.WriteLine(absoluteUri.ToString()) Else Console.WriteLine("Unable to resolve the base Uri and relative Uri") End If Return absoluteUri End Function End Class
using System; using System.IO; using System.Xml; using System.Security.Cryptography; using System.Security.Cryptography.Xml; class Class1 { [STAThread] static void Main(string[] args) { // Encrypt a sample XML string. XmlDocument productsXml = LoadProducts(); ShowTransformProperties(productsXml); // Encrypt an XPath Xml string. XmlDocument transformXml = LoadTransformByXml(); ShowTransformProperties(transformXml); // Use XmlDsigXPathTransform to resolve a Uri. Uri baseUri = new Uri("http://www.contoso.com"); string relativeUri = "xml"; Uri absoluteUri = ResolveUris(baseUri, relativeUri); Console.WriteLine("This sample completed successfully; " + "press Enter to exit."); Console.ReadLine(); } // Encrypt the text in the specified XmlDocument. private static void ShowTransformProperties(XmlDocument xmlDoc) { // Create a new XMLDocument object. XmlDocument doc = new XmlDocument(); // Create a new XmlElement. XmlElement xPathElem = doc.CreateElement("XPath"); // Set the element text to the value // of the XPath string. xPathElem.InnerText = "ancestor-or-self::PRODUCTS"; // Create a new XmlDsigXPathTransform object. XmlDsigXPathTransform xmlTransform = new XmlDsigXPathTransform(); // Load the XPath XML from the element. xmlTransform.LoadInnerXml(xPathElem.SelectNodes(".")); // Ensure the transform is using the proper algorithm. xmlTransform.Algorithm = SignedXml.XmlDsigXPathTransformUrl; // Retrieve the XML representation of the current transform. XmlElement xmlInTransform = xmlTransform.GetXml(); Console.WriteLine("\nXml representation of the current transform: "); Console.WriteLine(xmlInTransform.OuterXml); // Retrieve the valid input types for the current transform. Type[] validInTypes = xmlTransform.InputTypes; // Verify the xmlTransform can accept the XMLDocument as an // input type. for (int i = 0; i < validInTypes.Length; i++) { if (validInTypes[i] == xmlDoc.GetType()) { // Load the document into the transfrom. xmlTransform.LoadInput(xmlDoc); try { // This transform is created for demonstration purposes. XmlDsigXPathTransform secondTransform = new XmlDsigXPathTransform(); string classDescription = secondTransform.ToString(); xmlTransform.LoadInnerXml(xPathElem.SelectNodes(".")); ; } catch (CryptographicException) { Console.WriteLine("Caught exception while trying to " + "load the specified Xml document. The document " + "requires an XPath element to be valid."); } break; } } Type[] validOutTypes = xmlTransform.OutputTypes; for (int i = validOutTypes.Length - 1; i >= 0; i--) { if (validOutTypes[i] == typeof(System.Xml.XmlDocument)) { try { Type xmlDocumentType = typeof(System.Xml.XmlDocument); XmlDocument xmlDocumentOutput = (XmlDocument) xmlTransform.GetOutput(xmlDocumentType); // Display to the console the Xml before and after // encryption. Console.WriteLine("Result of the GetOutput method call" + " from the current transform: " + xmlDocumentOutput.OuterXml); } catch (Exception ex) { Console.WriteLine("Unexpected exception caught: " + ex.ToString()); } break; } else if (validOutTypes[i] == typeof(System.Xml.XmlNodeList)) { try { Type xmlNodeListType = typeof(System.Xml.XmlNodeList); XmlNodeList xmlNodes = (XmlNodeList) xmlTransform.GetOutput(xmlNodeListType); // Display to the console the Xml before and after // encryption. Console.WriteLine("Encoding the following message: " + xmlDoc.InnerText); Console.WriteLine("Nodes of the XmlNodeList retrieved " + "from GetOutput:"); for (int j = 0; j < xmlNodes.Count; j++) { Console.WriteLine("Node " + j + " has the following name: " + xmlNodes.Item(j).Name + " and the following InnerXml: " + xmlNodes.Item(j).InnerXml); } } catch (Exception ex) { Console.WriteLine("Unexpected exception caught: " + ex.ToString()); } break; } else { object outputObject = xmlTransform.GetOutput(); } } } // Create an XML document for the dsig namespace. private static XmlDocument LoadTransformByXml() { XmlDocument xmlDoc = new XmlDocument(); string transformXml = "<Signature><Reference URI=''><Transforms>"; transformXml += "<Transform><XPath "; transformXml += "xmlns:dsig='http://www.w3.org/2000/09/xmldsig#'>"; transformXml += "not(ancestor-or-self::dsig:Signature)"; transformXml += "</XPath></Transform>"; transformXml += "</Transforms></Reference></Signature>"; xmlDoc.LoadXml(transformXml); return xmlDoc; } // Create an XML document describing various products. private static XmlDocument LoadProducts() { XmlDocument xmlDoc = new XmlDocument(); string contosoProducts = "<PRODUCTS>"; contosoProducts += "<PRODUCT><ID>123</ID>"; contosoProducts += "<DESCRIPTION>Router</DESCRIPTION></PRODUCT>"; contosoProducts += "<PRODUCT><ID>456</ID>"; contosoProducts += "<DESCRIPTION>Keyboard</DESCRIPTION></PRODUCT>"; contosoProducts += "<PRODUCT><ID>789</ID>"; contosoProducts += "<DESCRIPTION>Monitor</DESCRIPTION></PRODUCT>"; contosoProducts += "</PRODUCTS>"; xmlDoc.LoadXml(contosoProducts); return xmlDoc; } // Resolve the specified base and relative Uri's . private static Uri ResolveUris(Uri baseUri, string relativeUri) { XmlUrlResolver xmlResolver = new XmlUrlResolver(); xmlResolver.Credentials = System.Net.CredentialCache.DefaultCredentials; XmlDsigXPathTransform xmlTransform = new XmlDsigXPathTransform(); xmlTransform.Resolver = xmlResolver; Uri absoluteUri = xmlResolver.ResolveUri(baseUri, relativeUri); if (absoluteUri != null) { Console.WriteLine( "\nResolved the base Uri and relative Uri to the following:"); Console.WriteLine(absoluteUri.ToString()); } else { Console.WriteLine( "Unable to resolve the base Uri and relative Uri"); } return absoluteUri; } }

System.Security.Cryptography.Xml.Transform
System.Security.Cryptography.Xml.XmlDsigXPathTransform


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


XmlDsigXPathTransform コンストラクタ
アセンブリ: System.Security (system.security.dll 内)


XmlDsigXPathTransform クラスを使用して XML ドキュメントの署名および検証を行うコードの例を次に示します。この例では、エンベロープ シグネチャを作成しています。
' ' This example signs an XML file using an ' envelope signature. It then verifies the ' signed XML. ' Imports System Imports System.Security.Cryptography Imports System.Security.Cryptography.X509Certificates Imports System.Security.Cryptography.Xml Imports System.Text Imports System.Xml Module SignVerifyEnvelope Sub Main(ByVal args() As String) ' Generate a signing key. Dim Key As New RSACryptoServiceProvider() Try ' Create an XML file to sign. CreateSomeXml("Example.xml") Console.WriteLine("New XML file created.") ' Sign the XML that was just created and save it in a ' new file. SignXmlFile("Example.xml", "SignedExample.xml", Key, "ancestor-or-self::TempElement") Console.WriteLine("XML file signed.") ' Verify the signature of the signed XML. Console.WriteLine("Verifying signature...") Dim result As Boolean = VerifyXmlFile("SignedExample.xml") ' Display the results of the signature verification to \ ' the console. If result Then Console.WriteLine("The XML signature is valid.") Else Console.WriteLine("The XML signature is not valid.") End If Catch e As CryptographicException Console.WriteLine(e.Message) Finally Key.Clear() End Try End Sub ' Sign an XML file and save the signature in a new file. Sub SignXmlFile(ByVal FileName As String, ByVal SignedFileName As String, ByVal Key As RSA, ByVal XPathString As String) ' Create a new XML document. Dim doc As New XmlDocument() ' Format the document to ignore white spaces. doc.PreserveWhitespace = False ' Load the passed XML file using it's name. doc.Load(New XmlTextReader(FileName)) ' Create a SignedXml object. Dim signedXml As New SignedXml(doc) ' Add the key to the SignedXml document. signedXml.SigningKey = Key ' Create a reference to be signed. Dim reference As New Reference() reference.Uri = "" ' Create an XmlDsigXPathTransform object using ' the helper method 'CreateXPathTransform' defined ' later in this sample. Dim XPathTransform As XmlDsigXPathTransform = CreateXPathTransform(XPathString) ' Add the transform to the reference. reference.AddTransform(XPathTransform) ' Add the reference to the SignedXml object. signedXml.AddReference(reference) ' Add an RSAKeyValue KeyInfo (optional; helps recipient find key to validate). Dim keyInfo As New KeyInfo() keyInfo.AddClause(New RSAKeyValue(CType(Key, RSA))) signedXml.KeyInfo = keyInfo ' Compute the signature. signedXml.ComputeSignature() ' Get the XML representation of the signature and save ' it to an XmlElement object. Dim xmlDigitalSignature As XmlElement = signedXml.GetXml() ' Append the element to the XML document. doc.DocumentElement.AppendChild(doc.ImportNode(xmlDigitalSignature, True)) ' Save the signed XML document to a file specified ' using the passed string. Dim xmltw As New XmlTextWriter(SignedFileName, New UTF8Encoding(False)) doc.WriteTo(xmltw) xmltw.Close() End Sub ' Verify the signature of an XML file and return the result. Function VerifyXmlFile(ByVal Name As String) As [Boolean] ' Create a new XML document. Dim xmlDocument As New XmlDocument() ' Format using white spaces. xmlDocument.PreserveWhitespace = True ' Load the passed XML file into the document. xmlDocument.Load(Name) ' Create a new SignedXml object and pass it ' the XML document class. Dim signedXml As New SignedXml(xmlDocument) ' Find the "Signature" node and create a new ' XmlNodeList object. Dim nodeList As XmlNodeList = xmlDocument.GetElementsByTagName("Signature") ' Load the signature node. signedXml.LoadXml(CType(nodeList(0), XmlElement)) ' Check the signature and return the result. Return signedXml.CheckSignature() End Function ' Create the XML that represents the transform. Function CreateXPathTransform(ByVal XPathString As String) As XmlDsigXPathTransform ' Create a new XMLDocument object. Dim doc As New XmlDocument() ' Create a new XmlElement. Dim xPathElem As XmlElement = doc.CreateElement("XPath") ' Set the element text to the value ' of the XPath string. xPathElem.InnerText = XPathString ' Create a new XmlDsigXPathTransform object. Dim xForm As New XmlDsigXPathTransform() ' Load the XPath XML from the element. xForm.LoadInnerXml(xPathElem.SelectNodes(".")) ' Return the XML that represents the transform. Return xForm End Function ' Create example data to sign. Sub CreateSomeXml(ByVal FileName As String) ' Create a new XmlDocument object. Dim document As New XmlDocument() ' Create a new XmlNode object. Dim node As XmlNode = document.CreateNode(XmlNodeType.Element, "", "MyXML", "Don't_Sign") ' Append the node to the document. document.AppendChild(node) ' Create a new XmlNode object. Dim subnode As XmlNode = document.CreateNode(XmlNodeType.Element, "", "TempElement", "Sign") ' Add some text to the node. subnode.InnerText = "Here is some data to sign." ' Append the node to the document. document.DocumentElement.AppendChild(subnode) ' Save the XML document to the file name specified. Dim xmltw As New XmlTextWriter(FileName, New UTF8Encoding(False)) document.WriteTo(xmltw) xmltw.Close() End Sub End Module
// // This example signs an XML file using an // envelope signature. It then verifies the // signed XML. // using System; using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; using System.Security.Cryptography.Xml; using System.Text; using System.Xml; public class SignVerifyEnvelope { public static void Main(String[] args) { // Generate a signing key. RSACryptoServiceProvider Key = new RSACryptoServiceProvider(); try { // Create an XML file to sign. CreateSomeXml("Example.xml"); Console.WriteLine("New XML file created."); // Sign the XML that was just created and save it in a // new file. SignXmlFile("Example.xml", "SignedExample.xml", Key, "ancestor-or-self::TempElement"); Console.WriteLine("XML file signed."); // Verify the signature of the signed XML. Console.WriteLine("Verifying signature..."); bool result = VerifyXmlFile("SignedExample.xml"); // Display the results of the signature verification to \ // the console. if (result) { Console.WriteLine("The XML signature is valid."); } else { Console.WriteLine("The XML signature is not valid."); } } catch (CryptographicException e) { Console.WriteLine(e.Message); } finally { Key.Clear(); } } // Sign an XML file and save the signature in a new file. public static void SignXmlFile(string FileName, string SignedFileName, RSA Key, string XPathString) { // Create a new XML document. XmlDocument doc = new XmlDocument(); // Format the document to ignore white spaces. doc.PreserveWhitespace = false; // Load the passed XML file using it's name. doc.Load(new XmlTextReader(FileName)); // Create a SignedXml object. SignedXml signedXml = new SignedXml(doc); // Add the key to the SignedXml document. signedXml.SigningKey = Key; // Create a reference to be signed. Reference reference = new Reference(); reference.Uri = ""; // Create an XmlDsigXPathTransform object using // the helper method 'CreateXPathTransform' defined // later in this sample. XmlDsigXPathTransform XPathTransform = CreateXPathTransform(XPathString); // Add the transform to the reference. reference.AddTransform(XPathTransform); // Add the reference to the SignedXml object. signedXml.AddReference(reference); // Add an RSAKeyValue KeyInfo (optional; helps recipient find key to validate). KeyInfo keyInfo = new KeyInfo(); keyInfo.AddClause(new RSAKeyValue((RSA)Key)); signedXml.KeyInfo = keyInfo; // Compute the signature. signedXml.ComputeSignature(); // Get the XML representation of the signature and save // it to an XmlElement object. XmlElement xmlDigitalSignature = signedXml.GetXml(); // Append the element to the XML document. doc.DocumentElement.AppendChild(doc.ImportNode(xmlDigitalSignature, true)); // Save the signed XML document to a file specified // using the passed string. XmlTextWriter xmltw = new XmlTextWriter(SignedFileName, new UTF8Encoding(false)); doc.WriteTo(xmltw); xmltw.Close(); } // Verify the signature of an XML file and return the result. public static Boolean VerifyXmlFile(String Name) { // Create a new XML document. XmlDocument xmlDocument = new XmlDocument(); // Format using white spaces. xmlDocument.PreserveWhitespace = true; // Load the passed XML file into the document. xmlDocument.Load(Name); // Create a new SignedXml object and pass it // the XML document class. SignedXml signedXml = new SignedXml(xmlDocument); // Find the "Signature" node and create a new // XmlNodeList object. XmlNodeList nodeList = xmlDocument.GetElementsByTagName("Signature"); // Load the signature node. signedXml.LoadXml((XmlElement)nodeList[0]); // Check the signature and return the result. return signedXml.CheckSignature(); } // Create the XML that represents the transform. private static XmlDsigXPathTransform CreateXPathTransform(string XPathString) { // Create a new XMLDocument object. XmlDocument doc = new XmlDocument(); // Create a new XmlElement. XmlElement xPathElem = doc.CreateElement("XPath"); // Set the element text to the value // of the XPath string. xPathElem.InnerText = XPathString; // Create a new XmlDsigXPathTransform object. XmlDsigXPathTransform xForm = new XmlDsigXPathTransform(); // Load the XPath XML from the element. xForm.LoadInnerXml(xPathElem.SelectNodes(".")); // Return the XML that represents the transform. return xForm; } // Create example data to sign. public static void CreateSomeXml(string FileName) { // Create a new XmlDocument object. XmlDocument document = new XmlDocument(); // Create a new XmlNode object. XmlNode node = document.CreateNode(XmlNodeType.Element, "", "MyXML", "Don't_Sign"); // Append the node to the document. document.AppendChild(node); // Create a new XmlNode object. XmlNode subnode = document.CreateNode(XmlNodeType.Element, "", "TempElement", "Sign"); // Add some text to the node. subnode.InnerText = "Here is some data to sign."; // Append the node to the document. document.DocumentElement.AppendChild(subnode); // Save the XML document to the file name specified. XmlTextWriter xmltw = new XmlTextWriter(FileName, new UTF8Encoding(false)); document.WriteTo(xmltw); xmltw.Close(); } }
// // This example signs an XML file using an // envelope signature. It then verifies the // signed XML. // #using <System.Xml.dll> #using <System.Security.dll> #using <System.dll> using namespace System; using namespace System::Security::Cryptography; using namespace System::Security::Cryptography::X509Certificates; using namespace System::Security::Cryptography::Xml; using namespace System::Text; using namespace System::Xml; // Create the XML that represents the transform. static XmlDsigXPathTransform^ CreateXPathTransform( String^ XPathString ) { // Create a new XMLDocument object. XmlDocument^ doc = gcnew XmlDocument; // Create a new XmlElement. XmlElement^ xPathElem = doc->CreateElement( L"XPath" ); // Set the element text to the value // of the XPath string. xPathElem->InnerText = XPathString; // Create a new XmlDsigXPathTransform object. XmlDsigXPathTransform^ xForm = gcnew XmlDsigXPathTransform; // Load the XPath XML from the element. xForm->LoadInnerXml( xPathElem->SelectNodes( L"." ) ); // Return the XML that represents the transform. return xForm; } // Sign an XML file and save the signature in a new file. static void SignXmlFile( String^ FileName, String^ SignedFileName, RSA^ Key, String^ XPathString ) { // Create a new XML document. XmlDocument^ doc = gcnew XmlDocument; // Format the document to ignore white spaces. doc->PreserveWhitespace = false; // Load the passed XML file using it's name. doc->Load( gcnew XmlTextReader( FileName ) ); // Create a SignedXml object. SignedXml^ signedXml = gcnew SignedXml( doc ); // Add the key to the SignedXml document. signedXml->SigningKey = Key; // Create a reference to be signed. Reference^ reference = gcnew Reference; reference->Uri = L""; // Create an XmlDsigXPathTransform object using // the helper method 'CreateXPathTransform' defined // later in this sample. XmlDsigXPathTransform^ XPathTransform = CreateXPathTransform( XPathString ); // Add the transform to the reference. reference->AddTransform( XPathTransform ); // Add the reference to the SignedXml object. signedXml->AddReference( reference ); // Add an RSAKeyValue KeyInfo (optional; helps recipient find key to validate). KeyInfo^ keyInfo = gcnew KeyInfo; keyInfo->AddClause( gcnew RSAKeyValue( dynamic_cast<RSA^>(Key) ) ); signedXml->KeyInfo = keyInfo; // Compute the signature. signedXml->ComputeSignature(); // Get the XML representation of the signature and save // it to an XmlElement object. XmlElement^ xmlDigitalSignature = signedXml->GetXml(); // Append the element to the XML document. doc->DocumentElement->AppendChild( doc->ImportNode( xmlDigitalSignature, true ) ); // Save the signed XML document to a file specified // using the passed string. XmlTextWriter^ xmltw = gcnew XmlTextWriter( SignedFileName,gcnew UTF8Encoding( false ) ); doc->WriteTo( xmltw ); xmltw->Close(); } // Verify the signature of an XML file and return the result. static Boolean VerifyXmlFile( String^ Name ) { // Create a new XML document. XmlDocument^ xmlDocument = gcnew XmlDocument; // Format using white spaces. xmlDocument->PreserveWhitespace = true; // Load the passed XML file into the document. xmlDocument->Load( Name ); // Create a new SignedXml object and pass it // the XML document class. SignedXml^ signedXml = gcnew SignedXml( xmlDocument ); // Find the "Signature" node and create a new // XmlNodeList object. XmlNodeList^ nodeList = xmlDocument->GetElementsByTagName( L"Signature" ); // Load the signature node. signedXml->LoadXml( dynamic_cast<XmlElement^>(nodeList->Item( 0 )) ); // Check the signature and return the result. return signedXml->CheckSignature(); } // Create example data to sign. static void CreateSomeXml( String^ FileName ) { // Create a new XmlDocument object. XmlDocument^ document = gcnew XmlDocument; // Create a new XmlNode object. XmlNode^ node = document->CreateNode( XmlNodeType::Element, L"", L"MyXML", L"Don't_Sign" ); // Append the node to the document. document->AppendChild( node ); // Create a new XmlNode object. XmlNode^ subnode = document->CreateNode( XmlNodeType::Element, L"", L"TempElement", L"Sign" ); // Add some text to the node. subnode->InnerText = L"Here is some data to sign."; // Append the node to the document. document->DocumentElement->AppendChild( subnode ); // Save the XML document to the file name specified. XmlTextWriter^ xmltw = gcnew XmlTextWriter( FileName,gcnew UTF8Encoding( false ) ); document->WriteTo( xmltw ); xmltw->Close(); } int main() { // Generate a signing key. RSACryptoServiceProvider^ Key = gcnew RSACryptoServiceProvider; try { // Create an XML file to sign. CreateSomeXml( L"Example.xml" ); Console::WriteLine( L"New XML file created." ); // Sign the XML that was just created and save it in a // new file. SignXmlFile( L"Example.xml", L"SignedExample.xml", Key, L"ancestor-or-self::TempElement" ); Console::WriteLine( L"XML file signed." ); // Verify the signature of the signed XML. Console::WriteLine( L"Verifying signature..." ); bool result = VerifyXmlFile( L"SignedExample.xml" ); // Display the results of the signature verification to \ // the console. if ( result ) { Console::WriteLine( L"The XML signature is valid." ); } else { Console::WriteLine( L"The XML signature is not valid." ); } } catch ( CryptographicException^ e ) { Console::WriteLine( e->Message ); } finally { Key->Clear(); } return 1; }

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


XmlDsigXPathTransform プロパティ

名前 | 説明 | |
---|---|---|
![]() | Algorithm | 現在の変換で実行されているアルゴリズムを識別する URI (Uniform Resource Identifier) を取得または設定します。 ( Transform から継承されます。) |
![]() | Context | 現在の Transform オブジェクトが実行されているドキュメント コンテキストを表す XmlElement オブジェクトを取得または設定します。 ( Transform から継承されます。) |
![]() | InputTypes | オーバーライドされます。 現在の XmlDsigXPathTransform オブジェクトの LoadInput メソッドに入力できる型の配列を取得します。 |
![]() | OutputTypes | オーバーライドされます。 現在の XmlDsigXPathTransform オブジェクトの GetOutput メソッドから出力できる型の配列を取得します。 |
![]() | PropagatedNamespaces | 署名に反映させる名前空間を格納する Hashtable オブジェクトを取得または設定します。 ( Transform から継承されます。) |
![]() | Resolver | 現在の XmlResolver オブジェクトを設定します。 ( Transform から継承されます。) |

XmlDsigXPathTransform メソッド

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
![]() | GetDigestedOutput | 派生クラスでオーバーライドされた場合は、Transform オブジェクトに関連付けられているダイジェストを返します。 ( Transform から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
![]() | GetOutput | オーバーロードされます。 オーバーライドされます。 現在の XmlDsigXPathTransform オブジェクトの出力を返します。 |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | GetXml | 現在の Transform オブジェクトの XML 表現を返します。 ( Transform から継承されます。) |
![]() | LoadInnerXml | オーバーライドされます。 指定した XmlNodeList オブジェクトを <Transform> 要素の変換に固有な内容として解析し、現在の XmlDsigXPathTransform オブジェクトの内部状態を <Transform> 要素に一致するように設定します。 |
![]() | LoadInput | オーバーライドされます。 指定した入力を現在の XmlDsigXPathTransform オブジェクトに読み込みます。 |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | GetInnerXml | オーバーライドされます。 XMLDSIG <Transform> 要素のサブ要素として含めるのに適した、XmlDsigXPathTransform オブジェクトのパラメータの XML 表現を返します。 |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

XmlDsigXPathTransform メンバ
W3C によって定義された、デジタル署名の XPath 変換を表します。
XmlDsigXPathTransform データ型で公開されるメンバを以下の表に示します。


名前 | 説明 | |
---|---|---|
![]() | Algorithm | 現在の変換で実行されているアルゴリズムを識別する URI (Uniform Resource Identifier) を取得または設定します。(Transform から継承されます。) |
![]() | Context | 現在の Transform オブジェクトが実行されているドキュメント コンテキストを表す XmlElement オブジェクトを取得または設定します。 (Transform から継承されます。) |
![]() | InputTypes | オーバーライドされます。 現在の XmlDsigXPathTransform オブジェクトの LoadInput メソッドに入力できる型の配列を取得します。 |
![]() | OutputTypes | オーバーライドされます。 現在の XmlDsigXPathTransform オブジェクトの GetOutput メソッドから出力できる型の配列を取得します。 |
![]() | PropagatedNamespaces | 署名に反映させる名前空間を格納する Hashtable オブジェクトを取得または設定します。 (Transform から継承されます。) |
![]() | Resolver | 現在の XmlResolver オブジェクトを設定します。(Transform から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
![]() | GetDigestedOutput | 派生クラスでオーバーライドされた場合は、Transform オブジェクトに関連付けられているダイジェストを返します。 (Transform から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
![]() | GetOutput | オーバーロードされます。 オーバーライドされます。 現在の XmlDsigXPathTransform オブジェクトの出力を返します。 |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | GetXml | 現在の Transform オブジェクトの XML 表現を返します。 (Transform から継承されます。) |
![]() | LoadInnerXml | オーバーライドされます。 指定した XmlNodeList オブジェクトを <Transform> 要素の変換に固有な内容として解析し、現在の XmlDsigXPathTransform オブジェクトの内部状態を <Transform> 要素に一致するように設定します。 |
![]() | LoadInput | オーバーライドされます。 指定した入力を現在の XmlDsigXPathTransform オブジェクトに読み込みます。 |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | GetInnerXml | オーバーライドされます。 XMLDSIG <Transform> 要素のサブ要素として含めるのに適した、XmlDsigXPathTransform オブジェクトのパラメータの XML 表現を返します。 |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

Weblioに収録されているすべての辞書からXmlDsigXPathTransformを検索する場合は、下記のリンクをクリックしてください。

- XmlDsigXPathTransformのページへのリンク