Evidence Evidence Evidence Evidence Class

定義

セキュリティ ポリシーがアクセス許可を決定するときに使用する一連の情報を定義します。Defines the set of information that constitutes input to security policy decisions. このクラスは継承できません。This class cannot be inherited.

public ref class Evidence sealed : System::Collections::ICollection
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public sealed class Evidence : System.Collections.ICollection
type Evidence = class
    interface ICollection
    interface IEnumerable
Public NotInheritable Class Evidence
Implements ICollection
継承
EvidenceEvidenceEvidenceEvidence
属性
実装

次のコード例は、新しいを作成する方法を示しますEvidence両方のクラスは、証拠とアセンブリの証拠をホストします。The following code example demonstrates how to create new Evidence classes with both host evidence and assembly evidence.

using namespace System;
using namespace System::Collections;
using namespace System::Security;
using namespace System::Security::Policy;
using namespace System::Security::Permissions;
using namespace System::Globalization;
public ref class Evidence_Example
{
public:
   bool CreateEvidence()
   {
      bool retVal = true;
      try
      {
         // Create empty evidence using the default contructor.
         Evidence^ ev1 = gcnew Evidence;
         Console::WriteLine( "Created empty evidence with the default constructor." );

         // Constructor used to create null host evidence.
         Evidence^ ev2a = gcnew Evidence( nullptr );
         Console::WriteLine( "Created an Evidence object with null host evidence." );

         // Constructor used to create host evidence.
         Url^ url = gcnew Url( "http://www.treyresearch.com" );
         Console::WriteLine( "Adding host evidence {0}", url );
         ev2a->AddHost( url );
         Evidence^ ev2b = gcnew Evidence( ev2a );
         Console::WriteLine( "Copy evidence into new evidence" );
         IEnumerator^ enum1 = ev2b->GetHostEnumerator();
         enum1->MoveNext();
         Console::WriteLine( enum1->Current );

         // Constructor used to create both host and assembly evidence.
         array<Object^>^oa1 = {};
         Site^ site = gcnew Site( "www.wideworldimporters.com" );
         array<Object^>^oa2 = {url,site};
         Evidence^ ev3a = gcnew Evidence( oa1,oa2 );
         enum1 = ev3a->GetHostEnumerator();
         IEnumerator^ enum2 = ev3a->GetAssemblyEnumerator();
         enum2->MoveNext();
         Object^ obj1 = enum2->Current;
         enum2->MoveNext();
         Console::WriteLine( "URL = {0}  Site = {1}", obj1, enum2->Current );
         
         // Constructor used to create null host and null assembly evidence.
         Evidence^ ev3b = gcnew Evidence( (array<Object^>^)nullptr, (array<Object^>^)nullptr );
         Console::WriteLine( "Create new evidence with null host and assembly evidence" );
      }
      catch ( Exception^ e )
      {
         Console::WriteLine( "Fatal error: {0}", e );
         return false;
      }

      return retVal;
   }

   Evidence^ DemonstrateEvidenceMembers()
   {
      Evidence^ myEvidence = gcnew Evidence;
      String^ sPubKeyBlob = "00240000048000009400000006020000"
      "00240000525341310004000001000100"
      "19390E945A40FB5730204A25FA5DC4DA"
      "B18688B412CB0EDB87A6EFC50E2796C9"
      "B41AD3040A7E46E4A02516C598678636"
      "44A0F74C39B7AB9C38C01F10AF4A5752"
      "BFBCDF7E6DD826676AD031E7BCE63393"
      "495BAD2CA4BE03B529A73C95E5B06BE7"
      "35CA0F622C63E8F54171BD73E4C8F193"
      "CB2664163719CA41F8159B8AC88F8CD3";
      array<Byte>^pubkey = HexsToArray( sPubKeyBlob );

      // Create a strong name.
      StrongName^ mSN = gcnew StrongName( gcnew StrongNamePublicKeyBlob( pubkey ),"SN01",gcnew Version( "0.0.0.0" ) );

      // Create assembly and host evidence.
      Console::WriteLine( "Adding assembly evidence." );
      myEvidence->AddAssembly( "SN01" );
      myEvidence->AddAssembly( gcnew Version( "0.0.0.0" ) );
      myEvidence->AddAssembly( mSN );
      Console::WriteLine( "Count of evidence items = {0}", myEvidence->Count );

      Url^ url = gcnew Url( "http://www.treyresearch.com" );
      Console::WriteLine( "Adding host evidence {0}", url );
      myEvidence->AddHost( url );
      PrintEvidence( myEvidence ).ToString();
      Console::WriteLine( "Count of evidence items = {0}", myEvidence->Count );

      Console::WriteLine( "\nCopy the evidence to an array using CopyTo, then display the array." );
      array<Object^>^evidenceArray = gcnew array<Object^>(myEvidence->Count);
      myEvidence->CopyTo( evidenceArray, 0 );
      for each (Object^ obj in evidenceArray)
      {
         Console::WriteLine(obj->ToString());
      }

      Console::WriteLine( "\nDisplay the contents of the properties." );
      Console::WriteLine( "Locked is the only property normally used by code." );
      Console::WriteLine( "IsReadOnly, IsSynchronized, and SyncRoot properties are not normally used." );
      
      Console::WriteLine( "\nThe default value for the Locked property = {0}", myEvidence->Locked );

      Console::WriteLine( "\nGet the hashcode for the evidence." );
      Console::WriteLine( "HashCode = {0}", myEvidence->GetHashCode() );

      Console::WriteLine( "\nGet the type for the evidence." );
      Console::WriteLine( "Type = {0}", myEvidence->GetType() );

      Console::WriteLine( "\nMerge new evidence with the current evidence." );
      array<Object^>^oa1 = {};
      Site^ site = gcnew Site( "www.wideworldimporters.com" );
      array<Object^>^oa2 = {url,site};
      Evidence^ newEvidence = gcnew Evidence( oa1,oa2 );
      myEvidence->Merge( newEvidence );
      Console::WriteLine( "Evidence count = {0}", PrintEvidence( myEvidence ) );

      Console::WriteLine( "\nRemove URL evidence." );
      myEvidence->RemoveType( url->GetType() );
      Console::WriteLine( "Evidence count is now: {0}", myEvidence->Count );

      Console::WriteLine( "\nMake a copy of the current evidence." );
      Evidence^ evidenceCopy = gcnew Evidence( myEvidence );
      Console::WriteLine( "Count of new evidence items = {0}", evidenceCopy->Count );
      Console::WriteLine( "Does the copy equal the current evidence? {0}", myEvidence->Equals( evidenceCopy ) );

      Console::WriteLine( "\nClear the current evidence." );
      myEvidence->Clear();
      Console::WriteLine( "Count is now {0}", myEvidence->Count );

      return myEvidence;
   }

   static int PrintEvidence( Evidence^ myEvidence )
   {
      int p = 0;
      Console::WriteLine( "\nCurrent evidence = " );
      if ( nullptr == myEvidence )
            return 0;

      IEnumerator^ list = myEvidence->GetEnumerator();
      IEnumerator^ myEnum1 = list;
      while ( myEnum1->MoveNext() )
      {
         Object^ obj = safe_cast<Object^>(myEnum1->Current);
         Console::WriteLine( obj );
         p++;
      }

      Console::WriteLine( "\n" );
      return p;
   }

   // Convert a hexadecimal string to an array.
   static array<Byte>^ HexsToArray( String^ sHexString )
   {
      array<Byte>^arr = gcnew array<Byte>(sHexString->Length / 2);
      for ( int i = 0; i < sHexString->Length; i += 2 )
      {
         arr[ i / 2 ] = Byte::Parse( sHexString->Substring( i, 2 ), NumberStyles::HexNumber );

      }
      return arr;
   }
};


// Main method.
int main()
{
   try
   {
      Evidence_Example^ EvidenceTest = gcnew Evidence_Example;
      bool ret = EvidenceTest->CreateEvidence();
      if ( ret )
      {
         Console::WriteLine( "Evidence successfully created." );
      }
      else
      {
         Console::WriteLine( "Evidence creation failed." );
      }
      EvidenceTest->DemonstrateEvidenceMembers();
   }
   catch ( Exception^ e ) 
   {
      Console::WriteLine( e );
      Environment::ExitCode = 101;
   }
}

using System;
using System.Collections;
using System.Security;
using System.Security.Policy;
using System.Security.Permissions;
using System.Globalization;

public class Evidence_Example
{
    public bool CreateEvidence()
    {
        bool retVal = true;

        try
        {
            // Create empty evidence using the default contructor.
            Evidence ev1 = new Evidence();
            Console.WriteLine("Created empty evidence with the default constructor.");

            // Constructor used to create null host evidence.
            Evidence ev2a = new Evidence(null);
            Console.WriteLine("Created an Evidence object with null host evidence.");

            // Constructor used to create host evidence.
            Url url = new Url("http://www.treyresearch.com");
            Console.WriteLine("Adding host evidence " + url.ToString());
            ev2a.AddHost(url);
            Evidence ev2b = new Evidence(ev2a);
            Console.WriteLine("Copy evidence into new evidence");
            IEnumerator enum1 = ev2b.GetHostEnumerator();
            enum1.MoveNext();
            Console.WriteLine(enum1.Current.ToString());
			
            // Constructor used to create both host and assembly evidence.
            Object [] oa1 = {};
            Site site = new Site("www.wideworldimporters.com");
            Object [] oa2 = { url, site };
            Evidence ev3a = new Evidence(oa1, oa2);
            enum1 = ev3a.GetHostEnumerator();
            IEnumerator enum2 = ev3a.GetAssemblyEnumerator();
            enum2.MoveNext();
            Object obj1 = enum2.Current;
            enum2.MoveNext();
            Console.WriteLine("URL = " + obj1.ToString() + "  Site = " + enum2.Current.ToString());
			
            // Constructor used to create null host and null assembly evidence.
            Evidence ev3b = new Evidence(null, null);
            Console.WriteLine("Create new evidence with null host and assembly evidence");
			
        }
        catch (Exception e)
        {
            Console.WriteLine("Fatal error: {0}", e.ToString());
            return false;
        }

        return retVal;
    }
    public Evidence DemonstrateEvidenceMembers()
    {
        Evidence myEvidence = new Evidence();
        string sPubKeyBlob =	"00240000048000009400000006020000" + 
            "00240000525341310004000001000100" + 
            "19390E945A40FB5730204A25FA5DC4DA" + 
            "B18688B412CB0EDB87A6EFC50E2796C9" + 
            "B41AD3040A7E46E4A02516C598678636" + 
            "44A0F74C39B7AB9C38C01F10AF4A5752" + 
            "BFBCDF7E6DD826676AD031E7BCE63393" + 
            "495BAD2CA4BE03B529A73C95E5B06BE7" + 
            "35CA0F622C63E8F54171BD73E4C8F193" + 
            "CB2664163719CA41F8159B8AC88F8CD3";
        Byte[] pubkey = HexsToArray(sPubKeyBlob);

        // Create a strong name.
        StrongName mSN = new StrongName(new StrongNamePublicKeyBlob(pubkey), "SN01", new Version("0.0.0.0"));

        // Create assembly and host evidence.
        Console.WriteLine("Adding assembly evidence.");
        myEvidence.AddAssembly("SN01");
        myEvidence.AddAssembly(new Version("0.0.0.0"));
        myEvidence.AddAssembly(mSN);
        Console.WriteLine("Count of evidence items = " + myEvidence.Count.ToString());
        Url url = new Url("http://www.treyresearch.com");
        Console.WriteLine("Adding host evidence " + url.ToString());
        myEvidence.AddHost(url);
        PrintEvidence(myEvidence).ToString();
        Console.WriteLine("Count of evidence items = " + myEvidence.Count.ToString());
        Console.WriteLine("\nCopy the evidence to an array using CopyTo, then display the array.");
        object[] evidenceArray = new object[myEvidence.Count];
        myEvidence.CopyTo(evidenceArray, 0);
        foreach (object obj in evidenceArray)
        {
            Console.WriteLine(obj.ToString());
        }
        Console.WriteLine("\nDisplay the contents of the properties.");
        Console.WriteLine("Locked is the only property normally used by code.");
        Console.WriteLine("IsReadOnly, IsSynchronized, and SyncRoot properties are not normally used.");
        Console.WriteLine("\nThe default value for the Locked property = " + myEvidence.Locked.ToString());
		
        Console.WriteLine("\nGet the hashcode for the evidence.");
        Console.WriteLine("HashCode = " + myEvidence.GetHashCode().ToString());
        Console.WriteLine("\nGet the type for the evidence.");
        Console.WriteLine("Type = " + myEvidence.GetType().ToString());
        Console.WriteLine("\nMerge new evidence with the current evidence.");
        Object [] oa1 = {};
        Site site = new Site("www.wideworldimporters.com");
        Object [] oa2 = { url, site };
        Evidence newEvidence = new Evidence(oa1, oa2);
        myEvidence.Merge(newEvidence);
        Console.WriteLine("Evidence count = " + PrintEvidence(myEvidence).ToString());
        Console.WriteLine("\nRemove URL evidence.");
        myEvidence.RemoveType(url.GetType());
        Console.WriteLine("Evidence count is now: " + myEvidence.Count.ToString());
        Console.WriteLine("\nMake a copy of the current evidence.");
        Evidence evidenceCopy = new Evidence(myEvidence);
        Console.WriteLine("Count of new evidence items = " + evidenceCopy.Count);
        Console.WriteLine("Does the copy equal the current evidence? " + myEvidence.Equals(evidenceCopy));
        Console.WriteLine("\nClear the current evidence.");
        myEvidence.Clear();
        Console.WriteLine("Count is now " + myEvidence.Count.ToString());
        return myEvidence;
    }
    public static int PrintEvidence(Evidence myEvidence)
    {
        int p = 0;
        Console.WriteLine("\nCurrent evidence = ");
        if (null == myEvidence) return 0;
        IEnumerator list = myEvidence.GetEnumerator();
        while (list.MoveNext())
        {
            Console.WriteLine(list.Current.ToString());
        }

        Console.WriteLine("\n");
        return p;
    }
    // Convert a hexidecimal string to an array.
    public static byte[] HexsToArray(string sHexString)
    {
        Byte[] array = new Byte[sHexString.Length/2];
        for (int i = 0; i < sHexString.Length; i += 2)
        {
            array[i / 2] = Byte.Parse(sHexString.Substring(i, 2), NumberStyles.HexNumber);
        }
        return array;
    }



    // Main method.
    public static void Main()
    {
        try
        {
            Evidence_Example EvidenceTest = new Evidence_Example();
            bool ret = EvidenceTest.CreateEvidence();
            if (ret)
            {
                Console.WriteLine("Evidence successfully created.");
            }
            else
            {
                Console.WriteLine("Evidence creation failed.");
            }
			
            EvidenceTest.DemonstrateEvidenceMembers();
        }
        catch(Exception e)
        {
	
            Console.WriteLine(e.ToString());
            Environment.ExitCode = 101;
        }
    }
}
Imports System
Imports System.Collections
Imports System.Security
Imports System.Security.Policy
Imports System.Security.Permissions
Imports System.Globalization
Imports Microsoft.VisualBasic



Public Class Evidence_Example

    Public Function CreateEvidence() As Boolean
        Dim retVal As Boolean = True

        Try
            ' Create empty evidence using the default contructor.
            Dim ev1 As New Evidence
            Console.WriteLine("Created empty evidence with the default constructor.")

            ' Constructor used to create null host evidence.
            Dim ev2a As New Evidence(Nothing)
            Console.WriteLine("Created an Evidence object with null host evidence.")

            ' Constructor used to create host evidence.
            Dim url As New Url("http://www.treyresearch.com")
            Console.WriteLine(("Adding host evidence " & url.ToString()))
            ev2a.AddHost(url)
            Dim ev2b As New Evidence(ev2a)
            Console.WriteLine("Copy evidence into new evidence")
            Dim enum1 As IEnumerator = ev2b.GetHostEnumerator()
            enum1.MoveNext()
            Console.WriteLine(enum1.Current.ToString())
            ' Constructor used to create both host and assembly evidence.
            Dim oa1() As [Object]
            Dim site As New Site("www.wideworldimporters.com")
            Dim oa2 As [Object]() = {url, site}
            Dim ev3a As New Evidence(oa1, oa2)
            enum1 = ev3a.GetHostEnumerator()
            Dim enum2 As IEnumerator = ev3a.GetAssemblyEnumerator()
            enum2.MoveNext()
            Dim obj1 As [Object] = enum2.Current
            enum2.MoveNext()
            Console.WriteLine(("URL = " & obj1.ToString() & "  Site = " & enum2.Current.ToString()))
            ' Constructor used to create null host and null assembly evidence.
            Dim ev3b As New Evidence(Nothing, Nothing)
            Console.WriteLine("Create new evidence with null host and assembly evidence")

        Catch e As Exception
            Console.WriteLine("Fatal error: {0}", e.ToString())
            Return False
        End Try

        Return retVal
    End Function 'CreateEvidence

    Public Function DemonstrateEvidenceMembers() As Evidence
        Dim myEvidence As New Evidence
        Dim sPubKeyBlob As String = "00240000048000009400000006020000" & "00240000525341310004000001000100" & "19390E945A40FB5730204A25FA5DC4DA" & "B18688B412CB0EDB87A6EFC50E2796C9" & "B41AD3040A7E46E4A02516C598678636" & "44A0F74C39B7AB9C38C01F10AF4A5752" & "BFBCDF7E6DD826676AD031E7BCE63393" & "495BAD2CA4BE03B529A73C95E5B06BE7" & "35CA0F622C63E8F54171BD73E4C8F193" & "CB2664163719CA41F8159B8AC88F8CD3"
        Dim pubkey As [Byte]() = HexsToArray(sPubKeyBlob)

        ' Create a strong name.
        Dim mSN As New StrongName(New StrongNamePublicKeyBlob(pubkey), "SN01", New Version("0.0.0.0"))

        ' Create assembly and host evidence.
        Console.WriteLine("Adding assembly evidence.")
        myEvidence.AddAssembly("SN01")
        myEvidence.AddAssembly(New Version("0.0.0.0"))
        myEvidence.AddAssembly(mSN)
        Console.WriteLine(("Count of evidence items = " & myEvidence.Count.ToString()))
        Dim url As New Url("http://www.treyresearch.com")
        Console.WriteLine(("Adding host evidence " & url.ToString()))
        myEvidence.AddHost(url)
        PrintEvidence(myEvidence).ToString()
        Console.WriteLine(("Count of evidence items = " & myEvidence.Count.ToString()))
        Console.WriteLine(ControlChars.Lf & "Copy the evidence to an array using CopyTo, then display the array.")
        Dim evidenceArray(myEvidence.Count - 1) As Object
        myEvidence.CopyTo(evidenceArray, 0)
        Dim obj As Object
        For Each obj In evidenceArray
            Console.WriteLine(obj.ToString())
        Next obj
        Console.WriteLine(ControlChars.Lf & "Display the contents of the properties.")
        Console.WriteLine("Locked is the only property normally used by code.")
        Console.WriteLine("IsReadOnly, IsSynchronized, and SyncRoot properties are not normally used.")
        Console.WriteLine((ControlChars.Lf & "The default value for the Locked property = " & myEvidence.Locked.ToString()))
        Console.WriteLine(ControlChars.Lf & "Get the hashcode for the evidence.")
        Console.WriteLine(("HashCode = " & myEvidence.GetHashCode().ToString()))
        Console.WriteLine(ControlChars.Lf & "Get the type for the evidence.")
        Console.WriteLine(("Type = " & myEvidence.GetType().ToString()))
        Console.WriteLine(ControlChars.Lf & "Merge new evidence with the current evidence.")
        Dim oa1() As [Object]
        Dim site As New Site("www.wideworldimporters.com")
        Dim oa2 As [Object]() = {url, site}
        Dim newEvidence As New Evidence(oa1, oa2)
        myEvidence.Merge(newEvidence)

        Console.WriteLine(("Evidence count = " & PrintEvidence(myEvidence).ToString()))
        Console.WriteLine(ControlChars.Lf & "Remove URL evidence.")
        myEvidence.RemoveType(url.GetType())
        Console.WriteLine(("Evidence count is now: " & myEvidence.Count.ToString()))
        Console.WriteLine(ControlChars.Lf & "Make a copy of the current evidence.")
        Dim evidenceCopy As New Evidence(myEvidence)
        Console.WriteLine(("Count of new evidence items = " & evidenceCopy.Count.ToString()))
        Console.WriteLine(("Does the copy equal the current evidence? " & myEvidence.Equals(evidenceCopy)))
        Console.WriteLine(ControlChars.Lf & "Clear the current evidence.")
        myEvidence.Clear()
        Console.WriteLine(("Count is now " & myEvidence.Count.ToString()))
        Return myEvidence
    End Function 'DemonstrateEvidenceMembers

    Public Shared Function PrintEvidence(ByVal myEvidence As Evidence) As Integer
        Dim p As Integer = 0
        Console.WriteLine(ControlChars.Lf & "Current evidence = ")
        If myEvidence Is Nothing Then
            Return 0
        End If
        Dim list As IEnumerator = myEvidence.GetEnumerator()
        Dim obj As Object
        While list.MoveNext()
            Console.WriteLine(list.Current.ToString())
            p = p + 1
        End While
        Console.WriteLine(ControlChars.Lf)
        Return p
    End Function 'PrintEvidence

    ' Convert a hexidecimal string to an array.
    Public Shared Function HexsToArray(ByVal sHexString As String) As Byte()
        Dim array(sHexString.Length / 2) As [Byte]
        Dim i As Integer
        For i = 0 To sHexString.Length - 2 Step 2
            array((i / 2)) = [Byte].Parse(sHexString.Substring(i, 2), NumberStyles.HexNumber)
        Next i
        Return array
    End Function 'HexsToArray




    ' Main method.
    Public Shared Sub Main()
        Try
            Dim EvidenceTest As New Evidence_Example
            Dim ret As Boolean = EvidenceTest.CreateEvidence()
            If ret Then
                Console.WriteLine("Evidence successfully created.")
            Else
                Console.WriteLine("Evidence creation failed.")
            End If

            EvidenceTest.DemonstrateEvidenceMembers()
        Catch e As Exception
            Console.WriteLine(e.ToString())
            Environment.ExitCode = 101
        End Try
    End Sub 'Main
End Class 'Evidence_Example

注釈

証拠の一般的な形式では、署名およびコードの元の場所が含まれますが、何も可能性があることができます。Common forms of evidence include signatures and location of origin of code, but can potentially be anything. セキュリティ ポリシーによって認識される任意の型のオブジェクトは、証拠を表します。Objects of any type that are recognized by security policy represent evidence.

コード グループはセキュリティ ポリシーで構成されます。特定のアセンブリ (セキュリティ権限を付与するコードの基本的な単位) は、コード グループのメンバーシップ条件を満たす場合に、コード グループのメンバーです。Security policy is composed of code groups; a particular assembly (the basic unit of code for granting security permissions) is a member of a code group if it satisfies the code group's membership condition. 証拠は、アセンブリが属しているコード グループを決定するメンバーシップ条件を使用してポリシーへの入力のセットです。Evidence is the set of inputs to policy that membership conditions use to determine to which code groups an assembly belongs.

Evidenceクラスはコレクション (を参照してくださいICollection) を表す証拠オブジェクトのセットを保持します。The Evidence class is a collection (see ICollection) that holds a set of objects that represent evidence. このクラスは、証拠のソースに対応する 2 つのセットを保持: 証拠とアセンブリの証拠をホストします。This class holds two sets that correspond to the source of the evidence: host evidence and assembly evidence.

ポリシーは、コードのアクセス許可を評価するときに、2 つの異なるソースから証拠を取得できます。Policy can get evidence from two different sources when evaluating permissions for code.

  • Host evidence ホストによって提供され、許可されているホストのみが提供できる、ControlEvidence権限。Host evidence is provided by the host, and can only be provided by hosts that have been granted the ControlEvidence permission. 通常、これは、コードとアセンブリのデジタル署名の元の証拠です。Typically, this is evidence of the origin of the code and digital signatures on the assembly. 通常は、配信元の証拠UrlSite、およびZone証拠。Evidence about origin typically includes Url, Site, and Zone evidence. 署名は、ソフトウェアの発行元 (AuthentiCode X.509v3 signature) と厳密な名前 id を参照してください。Signatures refer to software publisher (AuthentiCode X.509v3 signature) and strong name identities. デジタル署名に基づく id の両方の種類、アセンブリに組み込まれているがあり必要があります検証では、ホスト ポリシーに渡されます読み込まれると、セキュリティ システムは、署名を検証します。Both kinds of digital signature-based identity are built into the assembly, but must be validated and passed to policy by the host; when loaded, the security system verifies the signature. システムに、適切な証拠を作成し、対応する署名が有効な場合にのみポリシーに渡します。The system then creates the appropriate evidence and passes it to policy only if the corresponding signature is valid.

  • Assembly evidence アセンブリ自体の一部です。Assembly evidence is part of the assembly itself. 開発者または管理者は、ポリシーのための証拠のセットを拡張するアセンブリにカスタムの証拠をアタッチできます。Developers or administrators can attach custom evidence to the assembly to extend the set of evidence for policy. アセンブリの証拠は、アセンブリに署名する前に発生するアセンブリの生成時にのみ追加できます。Assembly evidence can only be added at the time of assembly generation, which occurs before the assembly is signed. セキュリティ システムの既定のポリシーが、アセンブリで提供される証拠を無視しますが、ポリシーをするように拡張できます。The default policy of the security system ignores assembly-provided evidence, but policy can be extended to accept it.

コンストラクター

Evidence() Evidence() Evidence() Evidence()

Evidence クラスの新しい空のインスタンスを初期化します。Initializes a new empty instance of the Evidence class.

Evidence(Evidence) Evidence(Evidence) Evidence(Evidence) Evidence(Evidence)

既存のインスタンスの簡易コピーから Evidence クラスの新しいインスタンスを初期化します。Initializes a new instance of the Evidence class from a shallow copy of an existing one.

Evidence(EvidenceBase[], EvidenceBase[]) Evidence(EvidenceBase[], EvidenceBase[]) Evidence(EvidenceBase[], EvidenceBase[]) Evidence(EvidenceBase[], EvidenceBase[])

ホストが提供する証拠とアセンブリが提供する証拠から成る複数の証拠セットから Evidence クラスの新しいインスタンスを初期化します。Initializes a new instance of the Evidence class from multiple sets of host and assembly evidence.

Evidence(Object[], Object[]) Evidence(Object[], Object[]) Evidence(Object[], Object[]) Evidence(Object[], Object[])

ホストが提供する証拠とアセンブリが提供する証拠から成る複数の証拠セットから Evidence クラスの新しいインスタンスを初期化します。Initializes a new instance of the Evidence class from multiple sets of host and assembly evidence.

プロパティ

Count Count Count Count

証拠セット内の証拠オブジェクトの数を取得します。Gets the number of evidence objects in the evidence set.

IsReadOnly IsReadOnly IsReadOnly IsReadOnly

証拠セットが読み取り専用かどうかを示す値を取得します。Gets a value indicating whether the evidence set is read-only.

IsSynchronized IsSynchronized IsSynchronized IsSynchronized

証拠セットがスレッド セーフかどうかを示す値を取得します。Gets a value indicating whether the evidence set is thread-safe.

Locked Locked Locked Locked

証拠がロックされているかどうかを示す値を取得または設定します。Gets or sets a value indicating whether the evidence is locked.

SyncRoot SyncRoot SyncRoot SyncRoot

同期のルートを取得します。Gets the synchronization root.

メソッド

AddAssembly(Object) AddAssembly(Object) AddAssembly(Object) AddAssembly(Object)

アセンブリによって提供される特定の証拠を証拠セットに追加します。Adds the specified assembly evidence to the evidence set.

AddAssemblyEvidence<T>(T) AddAssemblyEvidence<T>(T) AddAssemblyEvidence<T>(T) AddAssemblyEvidence<T>(T)

指定された型の証拠オブジェクトを、アセンブリによって提供される証拠リストに追加します。Adds an evidence object of the specified type to the assembly-supplied evidence list.

AddHost(Object) AddHost(Object) AddHost(Object) AddHost(Object)

ホストによって提供される特定の証拠を証拠セットに追加します。Adds the specified evidence supplied by the host to the evidence set.

AddHostEvidence<T>(T) AddHostEvidence<T>(T) AddHostEvidence<T>(T) AddHostEvidence<T>(T)

指定された型のホスト証拠をホスト証拠コレクションに追加します。Adds host evidence of the specified type to the host evidence collection.

Clear() Clear() Clear() Clear()

ホストおよびアセンブリ証拠を証拠セットから削除します。Removes the host and assembly evidence from the evidence set.

Clone() Clone() Clone() Clone()

この証拠オブジェクトのコピーを返します。Returns a duplicate copy of this evidence object.

CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32)

Array に証拠オブジェクトをコピーします。Copies evidence objects to an Array.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

指定した Evidence オブジェクトが、現在の Evidence と等しいかどうかを判断します。Determines whether the specified Evidence object is equal to the current Evidence.

GetAssemblyEnumerator() GetAssemblyEnumerator() GetAssemblyEnumerator() GetAssemblyEnumerator()

アセンブリによって提供される証拠を列挙します。Enumerates evidence provided by the assembly.

GetAssemblyEvidence<T>() GetAssemblyEvidence<T>() GetAssemblyEvidence<T>() GetAssemblyEvidence<T>()

指定した型のアセンブリ証拠をコレクションから取得します。Gets assembly evidence of the specified type from the collection.

GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

ホストが提供する証拠とアセンブリが提供する証拠の両方を含め、証拠セット内のすべての証拠を列挙します。Enumerates all evidence in the set, both that provided by the host and that provided by the assembly.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適している、Evidence オブジェクトのハッシュ コードを取得します。Gets a hash code for the Evidence object that is suitable for use in hashing algorithms and data structures such as a hash table.

GetHostEnumerator() GetHostEnumerator() GetHostEnumerator() GetHostEnumerator()

ホストによって提供される証拠を列挙します。Enumerates evidence supplied by the host.

GetHostEvidence<T>() GetHostEvidence<T>() GetHostEvidence<T>() GetHostEvidence<T>()

指定した型のホスト証拠をコレクションから取得します。Gets host evidence of the specified type from the collection.

GetType() GetType() GetType() GetType()

現在のインスタンスの Type を取得します。Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

現在の Object の簡易コピーを作成します。Creates a shallow copy of the current Object.

(Inherited from Object)
Merge(Evidence) Merge(Evidence) Merge(Evidence) Merge(Evidence)

指定した証拠セットを現在の証拠セットにマージします。Merges the specified evidence set into the current evidence set.

RemoveType(Type) RemoveType(Type) RemoveType(Type) RemoveType(Type)

特定の型の証拠をホストおよびアセンブリ列挙から削除します。Removes the evidence for a given type from the host and assembly enumerations.

ToString() ToString() ToString() ToString()

現在のオブジェクトを表す文字列を返します。Returns a string that represents the current object.

(Inherited from Object)

Extension Methods

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

IEnumerable の要素を、指定した型にキャストします。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

指定された型に基づいて IEnumerable の要素をフィルター処理します。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

クエリの並列化を有効にします。Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

IEnumerableIQueryable に変換します。Converts an IEnumerable to an IQueryable.

適用対象