IMembershipCondition Interface
Namespace: System.Security.Policy
Assembly: mscorlib.dll
- Implements: None
- Derived: None
Defines the contract for membership conditions that are used to determine whether a code group can grant code access permissions.
Interface Members
Methods
The IMembershipCondition interface defines the following methods:
-
bool Check(Evidence evidence)When overridden in a derived class, checks the specified evidence against the membership condition.
-
IMembershipCondition Copy()When overridden in a derived class, creates and returns an identical copy of the current membership condition.
-
bool Equals(object obj)When overridden in a derived class, determines whether the specified object is equal to the current object.
-
int GetHashCode()When overridden in a derived class, serves as a hash function for the type.
-
string ToString()When overridden in a derived class, returns a string representation of the membership condition.
Remarks
A membership condition is a set of criteria that the evidence of a code assembly must meet to be considered a member of a particular code group. Membership conditions are used in conjunction with code groups to implement a code access security (CAS) policy.
The .NET Framework provides several built-in membership conditions, such as:
Zone: Checks if the assembly originates from a specific security zone (e.g., Internet, Intranet, Trusted).Url: Checks if the assembly originates from a specific URL.ApplicationDirectory: Checks if the assembly is located in the application's root directory.Hash: Checks if the assembly has a specific hash value, ensuring its integrity.
You can implement the IMembershipCondition interface to create custom membership conditions tailored to your specific security requirements.
Requirements
Namespace: System.Security.Policy
Assembly: mscorlib (in mscorlib.dll)
See Also
- CodeGroup Class
- PolicyStatement Class
- Evidence Class
- IPrincipal Interface