WindowsSecurityDescriptor class

Namespace Runic.Platform.Administration.Windows in Runic.Platform.Administration.Windows 0.23.0

public sealed class WindowsSecurityDescriptor : IEquatable<WindowsSecurityDescriptor>

Inherits or implements IEquatable.

An immutable self-relative Windows security descriptor that compares by its binary form.

Remarks

The binary form is kept exactly as supplied or read, so owner, group, ACE order and inheritance flags are preserved. Use WindowsSecurityDescriptor.ToRawSecurityDescriptor to inspect or edit it with the Security.AccessControl types, and WindowsSecurityDescriptor.From to convert the result back.

Properties

BinaryForm

public ImmutableArray<byte> BinaryForm { get; }

The self-relative binary form.

Sddl

public string Sddl { get; }

The descriptor in Security Descriptor Definition Language, including every section it contains.

Methods

Equals

public bool Equals(WindowsSecurityDescriptor? other)

Inherits documentation from IEquatable.Equals.

Equals

public override bool Equals(object? obj)

Inherits documentation from Object.Equals.

From

public static WindowsSecurityDescriptor From(RawSecurityDescriptor descriptor)

Creates a descriptor from the binary form of descriptor. Later changes to it are not reflected.

FromBinaryForm

public static WindowsSecurityDescriptor FromBinaryForm(ReadOnlySpan<byte> binaryForm)

Creates a descriptor from a self-relative binary form, which is copied.

Exceptions

ArgumentException

The bytes are not one complete self-relative security descriptor.

FromSddl

public static WindowsSecurityDescriptor FromSddl(string sddl)

Creates a descriptor from SDDL.

Exceptions

ArgumentException

The SDDL is not a valid security descriptor.

GetHashCode

public override int GetHashCode()

Inherits documentation from Object.GetHashCode.

ToRawSecurityDescriptor

public RawSecurityDescriptor ToRawSecurityDescriptor()

Returns a new RawSecurityDescriptor for this descriptor on every call.

ToString

public override string ToString()

Operators

operator !=

public static bool operator !=(WindowsSecurityDescriptor? left, WindowsSecurityDescriptor? right)

Compares two descriptors by their binary form.

operator ==

public static bool operator ==(WindowsSecurityDescriptor? left, WindowsSecurityDescriptor? right)

Compares two descriptors by their binary form.