Edit

Share via


SecurityIdentifier Constructors

Definition

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Initializes a new instance of the SecurityIdentifier class.

Overloads

SecurityIdentifier(IntPtr)

Initializes a new instance of the SecurityIdentifier class by using a pointer to the binary form of a security identifier (SID).

SecurityIdentifier(String)

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

SecurityIdentifier(Byte[], Int32)

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

SecurityIdentifier(WellKnownSidType, SecurityIdentifier)

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

SecurityIdentifier(IntPtr)

Initializes a new instance of the SecurityIdentifier class by using a pointer to the binary form of a security identifier (SID).

C#
public SecurityIdentifier(IntPtr binaryForm);

Parameters

binaryForm
IntPtr

A pointer to the binary form of a SID.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, 6, 7, 8, 9, 10
.NET Framework 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

SecurityIdentifier(String)

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

C#
public SecurityIdentifier(string sddlForm);

Parameters

sddlForm
String

SDDL string for the SID used to create the SecurityIdentifier object.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, 6, 7, 8, 9, 10
.NET Framework 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

SecurityIdentifier(Byte[], Int32)

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

C#
public SecurityIdentifier(byte[] binaryForm, int offset);

Parameters

binaryForm
Byte[]

The byte array that represents the SID.

offset
Int32

The byte offset to use as the starting index in binaryForm.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, 6, 7, 8, 9, 10
.NET Framework 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

SecurityIdentifier(WellKnownSidType, SecurityIdentifier)

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

C#
public SecurityIdentifier(System.Security.Principal.WellKnownSidType sidType, System.Security.Principal.SecurityIdentifier? domainSid);
C#
public SecurityIdentifier(System.Security.Principal.WellKnownSidType sidType, System.Security.Principal.SecurityIdentifier domainSid);

Parameters

sidType
WellKnownSidType

One of the enumeration values. This value must not be LogonIdsSid.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, 6, 7, 8, 9, 10
.NET Framework 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