<PackageReference Include="System.Security.Permissions" Version="9.0.0-preview.4.24266.19" />

HostSecurityManager

public class HostSecurityManager
Allows the control and customization of security behavior for application domains.
public virtual PolicyLevel DomainPolicy { get; }

When overridden in a derived class, gets the security policy for the current application domain.

public virtual HostSecurityManagerOptions Flags { get; }

Gets the flag representing the security policy components of concern to the host.

Initializes a new instance of the HostSecurityManager class.

public virtual ApplicationTrust DetermineApplicationTrust(Evidence applicationEvidence, Evidence activatorEvidence, TrustManagerContext context)

Determines whether an application should be executed.

public virtual EvidenceBase GenerateAppDomainEvidence(Type evidenceType)

Requests a specific evidence type for the application domain.

public virtual EvidenceBase GenerateAssemblyEvidence(Type evidenceType, Assembly assembly)

Requests a specific evidence type for the assembly.

Determines which evidence types the host can supply for the application domain, if requested.

Determines which evidence types the host can supply for the assembly, if requested.

public virtual Evidence ProvideAppDomainEvidence(Evidence inputEvidence)

Provides the application domain evidence for an assembly being loaded.

public virtual Evidence ProvideAssemblyEvidence(Assembly loadedAssembly, Evidence inputEvidence)

Provides the assembly evidence for an assembly being loaded.

public virtual PermissionSet ResolvePolicy(Evidence evidence)

Determines what permissions to grant to code based on the specified evidence.