Table of Contents

Class SecurityIdentifier

Namespace
ArcanaDevelopment.adTempus.Shared
Assembly
ArcanaDevelopment.adTempus.Shared.dll

Wrapper for System.Security.Principal.SecurityIndentifier to make it serializable.

[DataContract]
public class SecurityIdentifier
Inheritance
object
SecurityIdentifier

Constructors

SecurityIdentifier()

public SecurityIdentifier()

SecurityIdentifier(byte[])

Creates a new SecurityIdentifier from a byte array

public SecurityIdentifier(byte[] source)

Parameters

NameTypeDescription
source byte[]
See Also

SecurityIdentifier(SecurityIdentifier)

Creates a new SecurityIdentifier from a raw SecurityIdentifier

public SecurityIdentifier(SecurityIdentifier sid)

Parameters

NameTypeDescription
sid SecurityIdentifier

SecurityIdentifier(WellKnownSidType)

public SecurityIdentifier(WellKnownSidType sidType)

Parameters

NameTypeDescription
sidType WellKnownSidType

SecurityIdentifier(string)

Creates a new SecurityIdentifier from an SDDL string.

public SecurityIdentifier(string source)

Parameters

NameTypeDescription
source string

Remarks

To create the SecurityIdentifier from a user name, use SecurityDescriptor.FromNameLookup

Properties

AccountResolved

Indicates whether the account was successfully resolved (SID mapped to name)

public bool AccountResolved { get; }

Property Value

bool

Domain

The Windows domain

public string Domain { get; set; }

Property Value

string

FullName

Gets the full user name in the form "domain\name"

[IgnoreDataMember]
public string FullName { get; }

Property Value

string

LookupErrorCode

The error code returned by Windows if the lookup operation failed

[IgnoreDataMember]
public int LookupErrorCode { get; }

Property Value

int

LookupErrorMessage

The error message if the lookup operation failed

[IgnoreDataMember]
public string LookupErrorMessage { get; }

Property Value

string

Name

The user name (ID)

public string Name { get; set; }

Property Value

string

NameUse

Indicates the type (use) of the SID

public SIDNameUse NameUse { get; set; }

Property Value

SIDNameUse

SID

The security identifier

[IgnoreDataMember]
public SecurityIdentifier SID { get; }

Property Value

SecurityIdentifier

SIDString

String used to serialize the SID.

[DataMember]
public string SIDString { get; set; }

Property Value

string

Methods

CompareTo(SecurityIdentifier)

Compares the SID to another

public int CompareTo(SecurityIdentifier other)

Parameters

NameTypeDescription
other SecurityIdentifier

Returns

int

Equals(SecurityIdentifier)

public bool Equals(SecurityIdentifier other)

Parameters

NameTypeDescription
other SecurityIdentifier

Returns

bool

Equals(SecurityIdentifier)

public bool Equals(SecurityIdentifier other)

Parameters

NameTypeDescription
other SecurityIdentifier

Returns

bool

FromNameLookup(string)

Creates a SecurityIdentifier by attempting to resolve a user name

public static SecurityIdentifier FromNameLookup(string name)

Parameters

NameTypeDescription
name string

Returns

SecurityIdentifier

IsWellKnownSid(WellKnownSidType)

Determines if this Security Identifier represents the specified well known SID.

public bool IsWellKnownSid(WellKnownSidType sidType)

Parameters

NameTypeDescription
sidType WellKnownSidType

Returns

bool

ToBinaryForm()

Returns the SID as a byte array

public byte[] ToBinaryForm()

Returns

byte[]

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.