Bewerken

Delen via


IIdentityPermissionFactory Interface

Definition

Caution

Code Access Security is not supported or honored by the runtime.

Defines the method that creates a new identity permission.

public interface class IIdentityPermissionFactory
[System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public interface IIdentityPermissionFactory
public interface IIdentityPermissionFactory
[System.Runtime.InteropServices.ComVisible(true)]
public interface IIdentityPermissionFactory
[<System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
type IIdentityPermissionFactory = interface
type IIdentityPermissionFactory = interface
[<System.Runtime.InteropServices.ComVisible(true)>]
type IIdentityPermissionFactory = interface
Public Interface IIdentityPermissionFactory
Derived
Attributes

Remarks

Caution

Code Access Security (CAS) has been deprecated across all versions of .NET Framework and .NET. Recent versions of .NET do not honor CAS annotations and produce errors if CAS-related APIs are used. Developers should seek alternative means of accomplishing security tasks.

Some types of evidence have a corresponding identity permission that is granted to assemblies with that evidence. This allows other code to make identity demands, so that only code with a specific piece of evidence will pass. For example, you can demand that your callers have a specific strong name; only callers with that strong name will pass the demand. By implementing IIdentityPermissionFactory for an evidence object, you provide an implementation of CreateIdentityPermission that the .NET Framework security system can call to get an identity permission that represents that piece of evidence. During policy resolution, the security system will call that method on all evidence objects that implement IIdentityPermissionFactory and grant the resulting identity permissions to the appropriate assembly.

Methods

CreateIdentityPermission(Evidence)

Creates a new identity permission for the specified evidence.

Applies to

See also