[ Team LiB ] Previous Section Next Section

StrongNameMembershipConditionserializable

System.Security.Policy (mscorlib.dll)sealed class
public sealed class StrongNameMembershipCondition : IMembershipCondition, System.Security.ISecurityEncodable, 
        System.Security.ISecurityPolicyEncodable, IConstantMembershipCondition {
// Public Constructors
   public StrongNameMembershipCondition(System.Security.Permissions.StrongNamePublicKeyBlob blob, 
        string name, Version version);
// Public Instance Properties
   public string Name{set; get; }
   public StrongNamePublicKeyBlob PublicKey{set; get; }
   public Version Version{set; get; }
// Public Instance Methods
   public bool Check(Evidence evidence);
// implements IMembershipCondition
   public IMembershipCondition Copy(  );   
// implements IMembershipCondition
   public override bool Equals(object o);        
// overrides object
   public void FromXml(System.Security.SecurityElement e);
// implements System.Security.ISecurityEncodable
   public void FromXml(System.Security.SecurityElement e, PolicyLevel level);
 // implements System.Security.ISecurityPolicyEncodable
   public override int GetHashCode(  );    
// overrides object
   public override string ToString(  );    
// overrides object
   public SecurityElement ToXml(  );       
// implements System.Security.ISecurityEncodable
   public SecurityElement ToXml(PolicyLevel level);       
// implements System.Security.ISecurityPolicyEncodable
}

This membership condition class uses StrongName evidence to determine if an assembly or application domain qualifies for membership of a CodeGroup. The PublicKey property contains a System.Security.Permissions.StrongNamePublicKeyBlob object that represents the public key information to base the membership test on. The Name and Version properties are optional, but allow the StrongNameMembershipCondition to perform a more specific and accurate test for membership.

When policy resolution calls the Check( ) method, if the provided Evidence collection contains a StrongName object, the StrongNameMembershipCondition compares its PublicKey, Name, and Version properties with the equivalent properties of the StrongName object. If the values match, then membership of the CodeGroup is granted.

StrongNameMembershipCondition objects are also used in the PolicyLevel class to identify a policy level's set of fully trusted assemblies.

Passed To

PolicyLevel.{AddFullTrustAssembly( ), RemoveFullTrustAssembly( )}

    [ Team LiB ] Previous Section Next Section