XmlLicenseTransform.Decryptor プロパティ
アセンブリ: System.Security (system.security.dll 内)

Dim instance As XmlLicenseTransform Dim value As IRelDecryptor value = instance.Decryptor instance.Decryptor = value
public: property IRelDecryptor^ Decryptor { IRelDecryptor^ get (); void set (IRelDecryptor^ value); }
/** @property */ public IRelDecryptor get_Decryptor () /** @property */ public void set_Decryptor (IRelDecryptor value)
public function get Decryptor () : IRelDecryptor public function set Decryptor (value : IRelDecryptor)
現在の XmlLicenseTransform オブジェクトの復号化機能。

XmlLicenseTransform オブジェクトは、IRelDecryptor インターフェイスを使用して、現在の <license> 要素から <encryptedGrant> 要素を復号化します。

次のコード例は、IRelDecryptor インターフェイスと XmlLicenseTransform クラスを使用して XML デジタル署名を検証する方法を示しています。
public static void CheckSignatureWithEncryptedGrant(string fileName, IRelDecryptor decryptor) { // Create a new XML document. XmlDocument xmlDocument = new XmlDocument(); XmlNamespaceManager nsManager = new XmlNamespaceManager(xmlDocument.NameTable); // Format using whitespaces. xmlDocument.PreserveWhitespace = true; // Load the passed XML file into the document. xmlDocument.Load(fileName); nsManager.AddNamespace("dsig", SignedXml.XmlDsigNamespaceUrl); // Find the "Signature" node and create a new XmlNodeList object. XmlNodeList nodeList = xmlDocument.SelectNodes("//dsig:Signature", nsManager); for (int i = 0, count = nodeList.Count; i < count; i++) { XmlDocument clone = xmlDocument.Clone() as XmlDocument; XmlNodeList signatures = clone.SelectNodes("//dsig:Signature", nsManager); // Create a new SignedXml object and pass into it the XML document clone. SignedXml signedXml = new SignedXml(clone); // Load the signature node. signedXml.LoadXml((XmlElement)signatures[i]); // Set the context for license transform Transform trans = ((Reference)signedXml.SignedInfo.References[0]).TransformChain[0]; if (trans is XmlLicenseTransform) { // Decryptor is used to decrypt encryptedGrant elements. if (decryptor != null) (trans as XmlLicenseTransform).Decryptor = decryptor; } // Check the signature and display the result. bool result = signedXml.CheckSignature(); if (result) Console.WriteLine("SUCCESS: CheckSignatureWithEncryptedGrant - issuer index #" + i.ToString()); else Console.WriteLine("FAILURE: CheckSignatureWithEncryptedGrant - issuer index #" + i.ToString()); } }
void CheckSignatureWithEncryptedGrant( String^ fileName, IRelDecryptor^ decryptor) { // Create a new XML document. XmlDocument^ sourceDocument = gcnew XmlDocument(); XmlNamespaceManager^ namespaceManager = gcnew XmlNamespaceManager(sourceDocument->NameTable); // Format using whitespaces. sourceDocument->PreserveWhitespace = true; // Load the passed XML file into the document. sourceDocument->Load(fileName); namespaceManager->AddNamespace("dsig", SignedXml::XmlDsigNamespaceUrl); // Find the "Signature" node and create a new // XmlNodeList object. XmlNodeList^ nodeList = sourceDocument->SelectNodes("//dsig:Signature", namespaceManager); for (int i = 0, count = nodeList->Count; i < count; i++) { XmlDocument^ clone = (XmlDocument^) sourceDocument->Clone(); XmlNodeList^ signatures = clone->SelectNodes("//dsig:Signature", namespaceManager); // Create a new SignedXml object and pass into it the // XML document clone. SignedXml^ signedDocument = gcnew SignedXml(clone); // Load the signature node. signedDocument->LoadXml((XmlElement^)signatures[i]); // Set the context for license transform Transform^ licenseTransform = ((Reference^)signedDocument-> SignedInfo->References[0])->TransformChain[0]; if ((licenseTransform::typeid == XmlLicenseTransform::typeid) && (decryptor != nullptr)) { // Decryptor is used to decrypt encryptedGrant // elements. ((XmlLicenseTransform^) licenseTransform)->Decryptor = decryptor; } // Check the signature and display the result. if (signedDocument->CheckSignature()) { Console::WriteLine("SUCCESS: " + "CheckSignatureWithEncryptedGrant - issuer index #" + i); } else { Console::WriteLine("FAILURE: " + "CheckSignatureWithEncryptedGrant - issuer index #" + i); } } }

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に収録されているすべての辞書からXmlLicenseTransform.Decryptor プロパティを検索する場合は、下記のリンクをクリックしてください。

- XmlLicenseTransform.Decryptor プロパティのページへのリンク