<PackageReference Include="System.Security.Principal.Windows" Version="5.0.0-preview.7.20364.11" />

SecurityIdentifier

Represents a security identifier (SID) and provides marshaling and comparison operations for SIDs.
public static readonly int MaxBinaryLength

Returns the maximum size, in bytes, of the binary representation of the security identifier.

public static readonly int MinBinaryLength

Returns the minimum size, in bytes, of the binary representation of the security identifier.

Returns the account domain security identifier (SID) portion from the SID represented by the SecurityIdentifier object if the SID represents a Windows account SID. If the SID does not represent a Windows account SID, this property returns null.

public int BinaryLength { get; }

Returns the length, in bytes, of the security identifier (SID) represented by the SecurityIdentifier object.

public SecurityIdentifier(byte[] binaryForm, int offset)

Initializes a new instance of the SecurityIdentifier class by using a specified binary representation of a security identifier (SID).

public SecurityIdentifier(IntPtr binaryForm)

Initializes a new instance of the SecurityIdentifier class by using an integer that represents the binary form of a security identifier (SID).

Initializes a new instance of the SecurityIdentifier class by using the specified well known security identifier (SID) type and domain SID.

public SecurityIdentifier(string sddlForm)

Initializes a new instance of the SecurityIdentifier class by using the specified security identifier (SID) in Security Descriptor Definition Language (SDDL) format.

public static bool op_Equality(SecurityIdentifier left, SecurityIdentifier right)

Compares two SecurityIdentifier objects to determine whether they are equal. They are considered equal if they have the same canonical representation as the one returned by the Value property or if they are both null.

public static bool op_Inequality(SecurityIdentifier left, SecurityIdentifier right)

Compares two SecurityIdentifier objects to determine whether they are not equal. They are considered not equal if they have different canonical name representations than the one returned by the Value property or if one of the objects is null and the other is not.

public int CompareTo(SecurityIdentifier sid)

Compares the current SecurityIdentifier object with the specified SecurityIdentifier object.

public bool Equals(SecurityIdentifier sid)

Indicates whether the specified SecurityIdentifier object is equal to the current SecurityIdentifier object.

public void GetBinaryForm(byte[] binaryForm, int offset)

Copies the binary representation of the specified security identifier (SID) represented by the SecurityIdentifier class to a byte array.

public bool IsAccountSid()

Returns a value that indicates whether the security identifier (SID) represented by this SecurityIdentifier object is a valid Windows account SID.

Returns a value that indicates whether the security identifier (SID) represented by this SecurityIdentifier object is from the same domain as the specified SID.

public bool IsWellKnown(WellKnownSidType type)

Returns a value that indicates whether the SecurityIdentifier object matches the specified well known security identifier (SID) type.