SignedXml.LoadXml メソッド
アセンブリ: System.Security (system.security.dll 内)



LoadXml メソッドを使用して XML ドキュメントを検証する方法を次のコード例に示します。
' Verify the signature of an XML file and return the result. Public Shared Function VerifyDetachedSignature(XmlSigFileName As String) As [Boolean] ' Create a new XML document. Dim xmlDocument As New XmlDocument() ' Load the passed XML file into the document. xmlDocument.Load(XmlSigFileName) ' Create a new SignedXMl object. Dim signedXml As New SignedXml() ' 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
// Verify the signature of an XML file and return the result. public static Boolean VerifyDetachedSignature(string XmlSigFileName) { // Create a new XML document. XmlDocument xmlDocument = new XmlDocument(); // Load the passed XML file into the document. xmlDocument.Load(XmlSigFileName); // Create a new SignedXMl object. SignedXml signedXml = new SignedXml(); // 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(); }
// Verify the signature of an XML file and return the result. Boolean VerifyDetachedSignature( String^ XmlSigFileName ) { // Create a new XML document. XmlDocument^ xmlDocument = gcnew XmlDocument; // Load the passed XML file into the document. xmlDocument->Load( XmlSigFileName ); // Create a new SignedXMl object. SignedXml^ signedXml = gcnew SignedXml; // Find the "Signature" node and create a new // XmlNodeList object. XmlNodeList^ nodeList = xmlDocument->GetElementsByTagName( "Signature" ); // Load the signature node. signedXml->LoadXml( safe_cast<XmlElement^>(nodeList->Item( 0 )) ); // Check the signature and return the result. return signedXml->CheckSignature(); }
// Verify the signature of an XML file and return the result. public static Boolean VerifyDetachedSignature(String xmlSigFileName) { // Create a new XML document. XmlDocument xmlDocument = new XmlDocument(); // Load the passed XML file into the document. xmlDocument.Load(xmlSigFileName); // Create a new SignedXMl object. SignedXml signedXml = new SignedXml(); // Find the "Signature" node and create a new // XmlNodeList object. XmlNodeList nodeList = xmlDocument.GetElementsByTagName("Signature"); // Load the signature node. signedXml.LoadXml(((XmlElement)(nodeList.get_ItemOf(0)))); // Check the signature and return the result. return new Boolean(signedXml.CheckSignature()); } //VerifyDetachedSignature

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


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

- SignedXml.LoadXml メソッドのページへのリンク