StrongNameMembershipCondition Class

Definition

Caution

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

Determines whether an assembly belongs to a code group by testing its strong name. This class cannot be inherited.

C#
[System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public sealed class StrongNameMembershipCondition : System.Security.ISecurityEncodable, System.Security.Policy.IMembershipCondition
C#
[System.Serializable]
public sealed class StrongNameMembershipCondition : System.Security.Policy.IMembershipCondition
C#
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class StrongNameMembershipCondition
C#
public sealed class StrongNameMembershipCondition : System.Security.ISecurityEncodable, System.Security.Policy.IMembershipCondition
Inheritance
StrongNameMembershipCondition
Attributes
Implements

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.

Strong names are well suited to specifying code assemblies to which you give a rich set of powerful permissions. Since strong names are cryptographically verified, attackers cannot impersonate rightful assemblies and use their permissions.

Constructors

StrongNameMembershipCondition(StrongNamePublicKeyBlob, String, Version)

Initializes a new instance of the StrongNameMembershipCondition class with the strong name public key blob, name, and version number that determine membership.

Properties

Name

Gets or sets the simple name of the StrongName for which the membership condition tests.

PublicKey

Gets or sets the StrongNamePublicKeyBlob of the StrongName for which the membership condition tests.

Version

Gets or sets the Version of the StrongName for which the membership condition tests.

Methods

Check(Evidence)

Determines whether the specified evidence satisfies the membership condition.

Copy()

Creates an equivalent copy of the current StrongNameMembershipCondition.

Equals(Object)

Determines whether the StrongName from the specified object is equivalent to the StrongName contained in the current StrongNameMembershipCondition.

FromXml(SecurityElement, PolicyLevel)

Reconstructs a security object with a specified state from an XML encoding.

FromXml(SecurityElement)

Reconstructs a security object with a specified state from an XML encoding.

GetHashCode()

Returns the hash code for the current StrongNameMembershipCondition.

GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Creates and returns a string representation of the current StrongNameMembershipCondition.

ToXml()

Creates an XML encoding of the security object and its current state.

ToXml(PolicyLevel)

Creates an XML encoding of the security object and its current state with the specified PolicyLevel.

Applies to

Product Versions (Obsolete)
.NET (8 (package-provided), 9 (package-provided), 10 (package-provided))
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1 (5, 6, 7, 8, 9, 10)