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

MachineKeySection クラス

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

Windows フォーム認証ビューステート検証、およびセッション状態アプリケーション分離で、暗号化復号化、およぴメディア アクセス制御 (MAC: Media Access Control) を実行する場合使用されるキー生成アルゴリズム制御する構成設定定義します。このクラス継承できません。

名前空間: System.Web.Configuration
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public NotInheritable Class
 MachineKeySection
    Inherits ConfigurationSection
Dim instance As MachineKeySection
public sealed class MachineKeySection : ConfigurationSection
public ref class MachineKeySection sealed :
 public ConfigurationSection
public final class MachineKeySection extends
 ConfigurationSection
public final class MachineKeySection extends
 ConfigurationSection
解説解説
使用例使用例

この例では、machineKey 要素 (ASP.NET 設定スキーマ) セクション複数属性に対して宣言によって値を指定する方法示してます。これらの属性には、MachineKeySection クラスメンバとしてもアクセスできます

次の構成ファイルの例では、machineKey 要素 (ASP.NET 設定スキーマ) セクションに対して宣言によって値を指定する方法示してます。

<system.web>
  <machineKey validationKey="AutoGenerate,IsolateApps" 
    decryptionKey="AutoGenerate,IsolateApps" 
    validation="SHA1"/>
</system.web>

MachineKeySection クラス使用する方法次のコード例示します

Imports System
Imports System.Collections.Generic
Imports System.Text
Imports System.Configuration
Imports System.Web
Imports System.Web.Configuration

Namespace Samples.Aspnet.SystemWebConfiguration
  Class UsingMachineKeySection
    Public Shared Sub Main()
      Try
        ' Set the path of the config file.
        Dim configPath As String
 = ""

        ' Get the Web application configuration object.
        Dim config As System.Configuration.Configuration
 = _
         System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(configPath)

        ' Get the section related object.
        Dim configSection As System.Web.Configuration.MachineKeySection
 = _
         CType(config.GetSection("system.web/machineKey"),
 _
         System.Web.Configuration.MachineKeySection)

        ' Display title and info.
        Console.WriteLine("ASP.NET Configuration Info")
        Console.WriteLine()

        ' Display Config details.
        Console.WriteLine("File Path: {0}", config.FilePath)
        Console.WriteLine("Section Path: {0}", configSection.SectionInformation.Name)

        ' Display ValidationKey property.
        Console.WriteLine("ValidationKey: {0}", _
         configSection.ValidationKey)

        ' Set ValidationKey property.
        configSection.ValidationKey = "AutoGenerate,IsolateApps"

        ' Display DecryptionKey property.
        Console.WriteLine("DecryptionKey: {0}", configSection.DecryptionKey)

        ' Set DecryptionKey property.
        configSection.DecryptionKey = "AutoGenerate,IsolateApps"

        ' Display Validation value.
        Console.WriteLine("Validation: {0}", configSection.Validation)

        ' Set Validation value.
        configSection.Validation = MachineKeyValidation.SHA1

        ' Update if not locked.
        If Not configSection.SectionInformation.IsLocked
 Then
          config.Save()
          Console.WriteLine("** Configuration updated.")
        Else
          Console.WriteLine("** Could not update, section is locked.")
        End If

      Catch e As Exception
        ' Unknown error.
        Console.WriteLine(e.ToString())
      End Try

      ' Display and wait
      Console.ReadLine()
    End Sub
  End Class
End Namespace
#region Using directives

using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;
using System.Web;
using System.Web.Configuration;

#endregion

namespace Samples.Aspnet.SystemWebConfiguration
{
  class UsingMachineKeySection
  {
    static void Main(string[]
 args)
    {
      try
      {
        // Set the path of the config file.
        string configPath = "";

        // Get the Web application configuration object.
        Configuration config = WebConfigurationManager.OpenWebConfiguration(configPath);

        // Get the section related object.
        MachineKeySection configSection = 
          (MachineKeySection)config.GetSection("system.web/machineKey");

        // Display title and info.
        Console.WriteLine("ASP.NET Configuration Info");
        Console.WriteLine();

        // Display Config details.
        Console.WriteLine("File Path: {0}",
          config.FilePath);
        Console.WriteLine("Section Path: {0}",
          configSection.SectionInformation.Name);

        // Display ValidationKey property.
        Console.WriteLine("ValidationKey: {0}",
          configSection.ValidationKey);

        // Set ValidationKey property.
        configSection.ValidationKey = "AutoGenerate,IsolateApps";

        // Display DecryptionKey property.
        Console.WriteLine("DecryptionKey: {0}",
          configSection.DecryptionKey);

        // Set DecryptionKey property.
        configSection.DecryptionKey = "AutoGenerate,IsolateApps";

        // Display Validation property.
        Console.WriteLine("Validation: {0}",
          configSection.Validation);

        // Set Validation property.
        configSection.Validation = MachineKeyValidation.SHA1;

        // Update if not locked.
        if (!configSection.SectionInformation.IsLocked)
        {
          config.Save();
          Console.WriteLine("** Configuration updated.");
        }
        else
        {
          Console.WriteLine("** Could not update, section is locked.");
        }
      }

      catch (Exception e)
      {
        // Unknown error.
        Console.WriteLine(e.ToString());
      }

      // Display and wait
      Console.ReadLine();
    }
  }
}
継承階層継承階層
System.Object
   System.Configuration.ConfigurationElement
     System.Configuration.ConfigurationSection
      System.Web.Configuration.MachineKeySection
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
MachineKeySection メンバ
System.Web.Configuration 名前空間
ConfigurationSection
その他の技術情報
machineKey 要素 (ASP.NET 設定スキーマ)
フォーム認証資格情報

MachineKeySection コンストラクタ

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

既定設定使用して MachineKeySection クラス新しインスタンス初期化します。

名前空間: System.Web.Configuration
アセンブリ: System.Web (system.web.dll 内)
構文構文

Dim instance As New MachineKeySection
public MachineKeySection ()
public:
MachineKeySection ()
public MachineKeySection ()
public function MachineKeySection ()
解説解説

MachineKeySection コンストラクタは、コード直接使用するためのものではありません。ASP.NET 構成システムによって呼び出されます。MachineKeySection クラスインスタンスは、GetSection メソッド使用して取得します

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
MachineKeySection クラス
MachineKeySection メンバ
System.Web.Configuration 名前空間
その他の技術情報
machineKey 要素 (ASP.NET 設定スキーマ)

MachineKeySection プロパティ


パブリック プロパティパブリック プロパティ

( プロテクト プロパティ参照)
  名前 説明
パブリック プロパティ Decryption データ復号化使用されるハッシュ アルゴリズム種類指定します
パブリック プロパティ DecryptionKey データ暗号化および復号化使用されるキー、またはキー生成されるプロセス取得または設定します
パブリック プロパティ ElementInformation  ConfigurationElement オブジェクトカスタマイズできない情報機能格納する ElementInformation オブジェクト取得します。 ( ConfigurationElement から継承されます。)
パブリック プロパティ LockAllAttributesExcept  ロックされている属性コレクション取得します。 ( ConfigurationElement から継承されます。)
パブリック プロパティ LockAllElementsExcept  ロックされている要素コレクション取得します。 ( ConfigurationElement から継承されます。)
パブリック プロパティ LockAttributes  ロックされている属性コレクション取得します。 ( ConfigurationElement から継承されます。)
パブリック プロパティ LockElements  ロックされている要素コレクション取得します。 ( ConfigurationElement から継承されます。)
パブリック プロパティ LockItem  要素ロックされているかどうかを示す値を取得または設定します。 ( ConfigurationElement から継承されます。)
パブリック プロパティ SectionInformation  ConfigurationSection オブジェクトカスタマイズできない情報機能格納する SectionInformation オブジェクト取得します。 ( ConfigurationSection から継承されます。)
パブリック プロパティ Validation データ検証使用されるハッシュ アルゴリズム種類指定します
パブリック プロパティ ValidationKey 暗号化されたデータ検証使用されるキー、またはキー生成されるプロセス取得または設定します
プロテクト プロパティプロテクト プロパティ
  名前 説明
プロテクト プロパティ ElementProperty  ConfigurationElement オブジェクト自体を表す ConfigurationElementProperty オブジェクト取得します。 ( ConfigurationElement から継承されます。)
プロテクト プロパティ EvaluationContext  ConfigurationElement オブジェクトの ContextInformation オブジェクト取得します。 ( ConfigurationElement から継承されます。)
プロテクト プロパティ Item  オーバーロードされます。 この ConfigurationElement オブジェクトプロパティ属性、または子要素取得または設定します。 ( ConfigurationElement から継承されます。)
プロテクト プロパティ Properties  プロパティコレクション取得します。 ( ConfigurationElement から継承されます。)
参照参照

関連項目

MachineKeySection クラス
System.Web.Configuration 名前空間
ConfigurationSection

その他の技術情報

machineKey 要素 (ASP.NET 設定スキーマ)
フォーム認証資格情報

MachineKeySection メソッド


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

プロテクト メソッドプロテクト メソッド
  名前 説明
プロテクト メソッド DeserializeElement  構成ファイルから XML読み取ります。 ( ConfigurationElement から継承されます。)
プロテクト メソッド DeserializeSection  構成ファイルから XML読み取ります。 ( ConfigurationSection から継承されます。)
プロテクト メソッド Finalize  Objectガベージ コレクションにより収集される前に、その Objectリソース解放しその他のクリーンアップ操作実行できるようにします。 ( Object から継承されます。)
プロテクト メソッド GetRuntimeObject  派生クラスオーバーライドされると、カスタム オブジェクト返します。 ( ConfigurationSection から継承されます。)
プロテクト メソッド Init  ConfigurationElement オブジェクト初期状態設定します。 ( ConfigurationElement から継承されます。)
プロテクト メソッド InitializeDefault  ConfigurationElement オブジェクト既定の値セット初期化するために使用します。 ( ConfigurationElement から継承されます。)
プロテクト メソッド IsModified  派生クラス実装された場合、この構成要素最後保存または読み込み以降変更されたかどうかを示します。 ( ConfigurationSection から継承されます。)
プロテクト メソッド ListErrors  この ConfigurationElement オブジェクトおよびすべてのサブ要素無効なプロパティエラーを、渡されリスト追加します。 ( ConfigurationElement から継承されます。)
プロテクト メソッド MemberwiseClone  現在の Object簡易コピー作成します。 ( Object から継承されます。)
プロテクト メソッド OnDeserializeUnrecognizedAttribute  逆シリカル化中に不明な属性発生したかどうかを示す値を取得します。 ( ConfigurationElement から継承されます。)
プロテクト メソッド OnDeserializeUnrecognizedElement  逆シリカル化中に不明な要素発生したかどうかを示す値を取得します。 ( ConfigurationElement から継承されます。)
プロテクト メソッド OnRequiredPropertyNotFound  必須プロパティが見つからなかったかどうかを示す値を取得します。 ( ConfigurationElement から継承されます。)
プロテクト メソッド PostDeserialize  シリアル化後に呼び出されます。 ( ConfigurationElement から継承されます。)
プロテクト メソッド PreSerialize  シリアル化前に呼び出されます。 ( ConfigurationElement から継承されます。)
プロテクト メソッド Reset  ConfigurationElement オブジェクト内部状態 (ロックプロパティ コレクションなど) をリセットします。 ( ConfigurationElement から継承されます。)
プロテクト メソッド ResetModified  派生クラス実装された場合、IsModified メソッドの値を falseリセットします。 ( ConfigurationSection から継承されます。)
プロテクト メソッド SerializeElement  派生クラス実装されている場合、この構成要素内容構成ファイル書き込みます。 ( ConfigurationElement から継承されます。)
プロテクト メソッド SerializeSection  ファイル書き込む 1 つセクションとして、ConfigurationSection オブジェクトのアンマージされたビューを含む XML 文字列作成します。 ( ConfigurationSection から継承されます。)
プロテクト メソッド SerializeToXmlElement  派生クラス実装されている場合、この構成要素外側タグ構成ファイル書き込みます。 ( ConfigurationElement から継承されます。)
プロテクト メソッド SetPropertyValue  プロパティ指定した値に設定します。 ( ConfigurationElement から継承されます。)
プロテクト メソッド SetReadOnly  ConfigurationElement オブジェクトおよびすべてのサブ要素に IsReadOnly プロパティ設定します。 ( ConfigurationElement から継承されます。)
プロテクト メソッド Unmerge  保存しないすべての値を削除するには、ConfigurationElement オブジェクト変更します。 ( ConfigurationElement から継承されます。)
参照参照

関連項目

MachineKeySection クラス
System.Web.Configuration 名前空間
ConfigurationSection

その他の技術情報

machineKey 要素 (ASP.NET 設定スキーマ)
フォーム認証資格情報

MachineKeySection メンバ

Windows フォーム認証ビューステート検証、およびセッション状態アプリケーション分離で、暗号化復号化、およぴメディア アクセス制御 (MAC: Media Access Control) を実行する場合使用されるキー生成アルゴリズム制御する構成設定定義します。このクラス継承できません。

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


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド MachineKeySection 既定設定使用して MachineKeySection クラス新しインスタンス初期化します。
パブリック プロパティパブリック プロパティ
( プロテクト プロパティ参照)
  名前 説明
パブリック プロパティ Decryption データ復号化使用されるハッシュ アルゴリズム種類指定します
パブリック プロパティ DecryptionKey データ暗号化および復号化使用されるキー、またはキー生成されるプロセス取得または設定します
パブリック プロパティ ElementInformation  ConfigurationElement オブジェクトカスタマイズできない情報機能格納する ElementInformation オブジェクト取得します。 (ConfigurationElement から継承されます。)
パブリック プロパティ LockAllAttributesExcept  ロックされている属性コレクション取得します。(ConfigurationElement から継承されます。)
パブリック プロパティ LockAllElementsExcept  ロックされている要素コレクション取得します。(ConfigurationElement から継承されます。)
パブリック プロパティ LockAttributes  ロックされている属性コレクション取得します。 (ConfigurationElement から継承されます。)
パブリック プロパティ LockElements  ロックされている要素コレクション取得します。(ConfigurationElement から継承されます。)
パブリック プロパティ LockItem  要素ロックされているかどうかを示す値を取得または設定します。(ConfigurationElement から継承されます。)
パブリック プロパティ SectionInformation  ConfigurationSection オブジェクトカスタマイズできない情報機能格納する SectionInformation オブジェクト取得します。 (ConfigurationSection から継承されます。)
パブリック プロパティ Validation データ検証使用されるハッシュ アルゴリズム種類指定します
パブリック プロパティ ValidationKey 暗号化されたデータ検証使用されるキー、またはキー生成されるプロセス取得または設定します
プロテクト プロパティプロテクト プロパティ
  名前 説明
プロテクト プロパティ ElementProperty  ConfigurationElement オブジェクト自体を表す ConfigurationElementProperty オブジェクト取得します。(ConfigurationElement から継承されます。)
プロテクト プロパティ EvaluationContext  ConfigurationElement オブジェクトの ContextInformation オブジェクト取得します。(ConfigurationElement から継承されます。)
プロテクト プロパティ Item  オーバーロードされます。 この ConfigurationElement オブジェクトプロパティ属性、または子要素取得または設定します。(ConfigurationElement から継承されます。)
プロテクト プロパティ Properties  プロパティコレクション取得します。(ConfigurationElement から継承されます。)
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
  名前 説明
プロテクト メソッド DeserializeElement  構成ファイルから XML読み取ります。 (ConfigurationElement から継承されます。)
プロテクト メソッド DeserializeSection  構成ファイルから XML読み取ります。 (ConfigurationSection から継承されます。)
プロテクト メソッド Finalize  Objectガベージ コレクションにより収集される前に、その Objectリソース解放しその他のクリーンアップ操作実行できるようにします。 (Object から継承されます。)
プロテクト メソッド GetRuntimeObject  派生クラスオーバーライドされると、カスタム オブジェクト返します。 (ConfigurationSection から継承されます。)
プロテクト メソッド Init  ConfigurationElement オブジェクト初期状態設定します。 (ConfigurationElement から継承されます。)
プロテクト メソッド InitializeDefault  ConfigurationElement オブジェクト既定の値セット初期化するために使用します。 (ConfigurationElement から継承されます。)
プロテクト メソッド IsModified  派生クラス実装された場合、この構成要素最後保存または読み込み以降変更されたかどうかを示します。 (ConfigurationSection から継承されます。)
プロテクト メソッド ListErrors  この ConfigurationElement オブジェクトおよびすべてのサブ要素無効なプロパティエラーを、渡されリスト追加します。 (ConfigurationElement から継承されます。)
プロテクト メソッド MemberwiseClone  現在の Object簡易コピー作成します。 (Object から継承されます。)
プロテクト メソッド OnDeserializeUnrecognizedAttribute  逆シリカル化中に不明な属性発生したかどうかを示す値を取得します。 (ConfigurationElement から継承されます。)
プロテクト メソッド OnDeserializeUnrecognizedElement  逆シリカル化中に不明な要素発生したかどうかを示す値を取得します。 (ConfigurationElement から継承されます。)
プロテクト メソッド OnRequiredPropertyNotFound  必須プロパティが見つからなかったかどうかを示す値を取得します。 (ConfigurationElement から継承されます。)
プロテクト メソッド PostDeserialize  シリアル化後に呼び出されます。 (ConfigurationElement から継承されます。)
プロテクト メソッド PreSerialize  シリアル化前に呼び出されます。 (ConfigurationElement から継承されます。)
プロテクト メソッド Reset  ConfigurationElement オブジェクト内部状態 (ロックプロパティ コレクションなど) をリセットします。 (ConfigurationElement から継承されます。)
プロテクト メソッド ResetModified  派生クラス実装された場合、IsModified メソッドの値を falseリセットします。 (ConfigurationSection から継承されます。)
プロテクト メソッド SerializeElement  派生クラス実装されている場合、この構成要素内容構成ファイル書き込みます。 (ConfigurationElement から継承されます。)
プロテクト メソッド SerializeSection  ファイル書き込む 1 つセクションとして、ConfigurationSection オブジェクトのアンマージされたビューを含む XML 文字列作成します。 (ConfigurationSection から継承されます。)
プロテクト メソッド SerializeToXmlElement  派生クラス実装されている場合、この構成要素外側タグ構成ファイル書き込みます。 (ConfigurationElement から継承されます。)
プロテクト メソッド SetPropertyValue  プロパティ指定した値に設定します。 (ConfigurationElement から継承されます。)
プロテクト メソッド SetReadOnly  ConfigurationElement オブジェクトおよびすべてのサブ要素に IsReadOnly プロパティ設定します。 (ConfigurationElement から継承されます。)
プロテクト メソッド Unmerge  保存しないすべての値を削除するには、ConfigurationElement オブジェクト変更します。 (ConfigurationElement から継承されます。)
参照参照

関連項目

MachineKeySection クラス
System.Web.Configuration 名前空間
ConfigurationSection

その他の技術情報

machineKey 要素 (ASP.NET 設定スキーマ)
フォーム認証資格情報


このページでは「.NET Framework クラス ライブラリ リファレンス」からMachineKeySectionを検索した結果を表示しています。
Weblioに収録されているすべての辞書からMachineKeySectionを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からMachineKeySection を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「MachineKeySection」の関連用語

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

   

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



MachineKeySectionのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS