IdentityReference Class
Namespace: System.Security.Principal
Assembly: mscorlib (in mscorlib.dll)
Represents an abstract base class for translating security identifiers (SIDs) into other security identifier types. This class is the base class for the SecurityIdentifier class.
Inheritance Hierarchy
Syntax
public abstract class IdentityReference : Object
Remarks
The IdentityReference class is used to represent security principals in a way that can be translated between different security identifier formats. The most common implementation of this class is the SecurityIdentifier class, which represents a security identifier (SID) for a user, group, or logon session.
The primary purpose of IdentityReference is to provide a common abstraction for SID objects that allows for interoperability and translation. For example, you might have a SID represented as a string in one domain and need to translate it to a SID object in another domain. The methods provided by IdentityReference and its derived classes facilitate these translations.
Key features and concepts related to IdentityReference include:
- Translation: The ability to convert one SID format to another.
- Value: The string representation of the SID.
- IsInvalid: A property to check if the SID is invalid.
- IsWellKnown: A property to check if the SID represents a well-known security principal (e.g., Everyone, Administrators).
Constructors
The IdentityReference class is an abstract class and cannot be instantiated directly. Its derived classes, such as SecurityIdentifier, provide constructors.
Methods
-
Equals(Object obj)
Determines whether the specified object is equal to the current object.
-
GetHashCode()
Serves as the default hash function.
-
GetType()
Gets the Type of the current instance.
-
IsEqual(IdentityReference identity)
Determines whether the specified
IdentityReferenceobject is equal to the current object. -
ToString()
Returns a string representation of the security identifier.
-
Translate(Type targetType)
Translates the security identifier into another type of security identifier.
-
Translate(string systemDomain)
Translates the security identifier to a specific domain.
Properties
-
IsInvalid
Gets a value that indicates whether the
IdentityReferenceis invalid. -
IsValidTargetType(Type targetType)
Determines whether the specified type is a valid target type for translation.
-
Value
Gets the string representation of the security identifier.
Requirements
Assembly: mscorlib (in mscorlib.dll)