XmlLicenseTransformとは? わかりやすく解説

XmlLicenseTransform クラス

メモ : このクラスは、.NET Framework version 2.0 で新しく追加されたものです。

XrML ライセンスを署名用に正規化するためのライセンス変換アルゴリズムを表します。

名前空間: System.Security.Cryptography.Xml
アセンブリ: System.Security (system.security.dll 内)
構文構文

Public Class XmlLicenseTransform
    Inherits Transform
Dim instance As XmlLicenseTransform
public class XmlLicenseTransform : Transform
public ref class XmlLicenseTransform : public
 Transform
public class XmlLicenseTransform extends Transform
public class XmlLicenseTransform extends
 Transform
解説解説

XmlLicenseTransform クラスは、MPEG REL (MPEG Rights Extension Language) で定義されているライセンス変換アルゴリズムを表します。

XrML を署名用に変換するには、XmlLicenseTransform クラスを使用します。

XmlLicenseTransform クラスを識別する URI (Uniform Resource Identifier) は、XmlLicenseTransformUrl フィールドによって定義されます。

使用例使用例

次のコード例は、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);
        }
    }
}
継承階層継承階層
System.Object
   System.Security.Cryptography.Xml.Transform
    System.Security.Cryptography.Xml.XmlLicenseTransform
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
XmlLicenseTransform メンバ
System.Security.Cryptography.Xml 名前空間

XmlLicenseTransform コンストラクタ


XmlLicenseTransform プロパティ


XmlLicenseTransform メソッド


パブリック メソッドパブリック メソッド

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

関連項目

XmlLicenseTransform クラス
System.Security.Cryptography.Xml 名前空間

XmlLicenseTransform メンバ

XrML ライセンスを署名用に正規化するためのライセンス変換アルゴリズムを表します。

XmlLicenseTransform データ型で公開されるメンバを以下の表に示します。


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

関連項目

XmlLicenseTransform クラス
System.Security.Cryptography.Xml 名前空間



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

「XmlLicenseTransform」の関連用語

XmlLicenseTransformのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



XmlLicenseTransformのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS