TrustManager Class
Represents the entity that manages the trust policy for code in a .NET Framework application.
The TrustManager class is the primary interface for code-based security policy.
It determines whether code has the necessary permissions to execute based on its origin,
publisher, and other evidence.
Overview
The TrustManager is a crucial component of the .NET Framework's security infrastructure.
It acts as a gatekeeper, evaluating code and making decisions about the level of trust to grant.
This involves examining various pieces of evidence associated with the code, such as:
- The URL from which the code was downloaded.
- The publisher's digital signature.
- The hash of the code itself.
- The application's configuration.
Based on this evidence and the configured security policies, the TrustManager
assigns a set of permissions to the code. If the granted permissions are insufficient for
an operation, a SecurityException will be thrown.
System.Security.PolicyAssembly:
mscorlib.dll
Syntax
public abstract class TrustManager : ISecurityEncodable, ISecurityProperty
Members
Methods
| Name | Description |
|---|---|
Resolve(Evidence evidence) |
Resolves the security policy for the given evidence. This method is called by the .NET Framework runtime to determine the permissions granted to code. |
Persist(Evidence evidence) |
Persists the security policy associated with the given evidence. This is typically used to save changes to trust decisions. |
Inherited Members
The TrustManager class inherits members from the following base classes and interfaces:
System.ObjectISecurityEncodableISecurityProperty
Requirements
| Requirement | Details |
|---|---|
| .NET Framework versions | Supported in: 4.5, 4.0, 3.5, 3.0, 2.0, 1.1 |
| Platform | Windows |
| Header | System.Security.dll |
| Namespace | System.Security.Policy |
See Also
Note: Code-based security has been deprecated in favor of role-based security in newer versions of the .NET Framework. While this class is still documented for compatibility, its use in new applications is generally discouraged.