using System;
using System.Runtime.InteropServices;
namespace System.Security.Principal
{
/// Represents a security identifier (SID) and provides marshaling and comparison operations for SIDs.
// Token: 0x020005B2 RID: 1458
[MonoTODO("not implemented")]
[ComVisible(false)]
public sealed class SecurityIdentifier : IdentityReference, IComparable
{
/// Initializes a new instance of the class by using the specified security identifier (SID) in Security Descriptor Definition Language (SDDL) format.
/// SDDL string for the SID used to created the object.
// Token: 0x06003549 RID: 13641 RVA: 0x000B734C File Offset: 0x000B554C
public SecurityIdentifier(string sddlForm)
{
if (sddlForm == null)
{
throw new ArgumentNullException("sddlForm");
}
this._value = sddlForm.ToUpperInvariant();
}
/// Initializes a new instance of the class by using a specified binary representation of a security identifier (SID).
/// The byte array that represents the SID.
/// The byte offset to use as the starting index in .
// Token: 0x0600354A RID: 13642 RVA: 0x000B7374 File Offset: 0x000B5574
public SecurityIdentifier(byte[] binaryForm, int offset)
{
if (binaryForm == null)
{
throw new ArgumentNullException("binaryForm");
}
if (offset < 0 || offset > binaryForm.Length - 1)
{
throw new ArgumentException("offset");
}
throw new NotImplementedException();
}
/// Initializes a new instance of the class by using an integer that represents the binary form of a security identifier (SID).
/// An integer that represents the binary form of a SID.
// Token: 0x0600354B RID: 13643 RVA: 0x000B73B0 File Offset: 0x000B55B0
public SecurityIdentifier(IntPtr binaryForm)
{
throw new NotImplementedException();
}
/// Initializes a new instance of the class by using the specified well known security identifier (SID) type and domain SID.
/// A value.This value must not be .
/// The domain SID. This value is required for the following values. This parameter is ignored for any other values.- - - - - - - - - - - - -
// Token: 0x0600354C RID: 13644 RVA: 0x000B73C0 File Offset: 0x000B55C0
public SecurityIdentifier(WellKnownSidType sidType, SecurityIdentifier domainSid)
{
switch (sidType)
{
case WellKnownSidType.AccountAdministratorSid:
case WellKnownSidType.AccountGuestSid:
case WellKnownSidType.AccountKrbtgtSid:
case WellKnownSidType.AccountDomainAdminsSid:
case WellKnownSidType.AccountDomainUsersSid:
case WellKnownSidType.AccountDomainGuestsSid:
case WellKnownSidType.AccountComputersSid:
case WellKnownSidType.AccountControllersSid:
case WellKnownSidType.AccountCertAdminsSid:
case WellKnownSidType.AccountSchemaAdminsSid:
case WellKnownSidType.AccountEnterpriseAdminsSid:
case WellKnownSidType.AccountPolicyAdminsSid:
case WellKnownSidType.AccountRasAndIasServersSid:
if (domainSid == null)
{
throw new ArgumentNullException("domainSid");
}
break;
default:
if (sidType == WellKnownSidType.LogonIdsSid)
{
throw new ArgumentException("sidType");
}
break;
}
}
/// Returns the account domain security identifier (SID) portion from the SID represented by the object if the SID represents a Windows account SID. If the SID does not represent a Windows account SID, this property returns .
/// The account domain SID portion from the SID represented by the object if the SID represents a Windows account SID; otherwise, it returns .
// Token: 0x17000A74 RID: 2676
// (get) Token: 0x0600354E RID: 13646 RVA: 0x000B7450 File Offset: 0x000B5650
public SecurityIdentifier AccountDomainSid
{
get
{
throw new ArgumentNullException("AccountDomainSid");
}
}
/// Returns the length, in bytes, of the security identifier (SID) represented by the object.
/// The length, in bytes, of the SID represented by the object.
// Token: 0x17000A75 RID: 2677
// (get) Token: 0x0600354F RID: 13647 RVA: 0x000B745C File Offset: 0x000B565C
public int BinaryLength
{
get
{
return -1;
}
}
/// Returns an uppercase Security Descriptor Definition Language (SDDL) string for the security identifier (SID) represented by this object.
/// An uppercase SDDL string for the SID represented by the object.
///
///
///
// Token: 0x17000A76 RID: 2678
// (get) Token: 0x06003550 RID: 13648 RVA: 0x000B7460 File Offset: 0x000B5660
public override string Value
{
get
{
return this._value;
}
}
/// Compares the current object with the specified object.
/// A signed number indicating the relative values of this instance and .Return Value Description Less than zero This instance is less than . Zero This instance is equal to . Greater than zero This instance is greater than .
/// The object to compare with the current object.
// Token: 0x06003551 RID: 13649 RVA: 0x000B7468 File Offset: 0x000B5668
public int CompareTo(SecurityIdentifier sid)
{
return this.Value.CompareTo(sid.Value);
}
/// Returns a value that indicates whether this object is equal to a specified object.
/// true if is an object with the same underlying type and value as this object; otherwise, false.
/// An object to compare with this object, or null.
// Token: 0x06003552 RID: 13650 RVA: 0x000B747C File Offset: 0x000B567C
public override bool Equals(object o)
{
return this.Equals(o as SecurityIdentifier);
}
/// Indicates whether the specified object is equal to the current object.
/// true if the value of is equal to the value of the current object.
/// The object to compare with the current object.
// Token: 0x06003553 RID: 13651 RVA: 0x000B748C File Offset: 0x000B568C
public bool Equals(SecurityIdentifier sid)
{
return !(sid == null) && sid.Value == this.Value;
}
/// Copies the binary representation of the specified security identifier (SID) represented by the class to a byte array.
/// The byte array to receive the copied SID.
/// The byte offset to use as the starting index in .
// Token: 0x06003554 RID: 13652 RVA: 0x000B74B8 File Offset: 0x000B56B8
public void GetBinaryForm(byte[] binaryForm, int offset)
{
if (binaryForm == null)
{
throw new ArgumentNullException("binaryForm");
}
if (offset < 0 || offset > binaryForm.Length - 1 - this.BinaryLength)
{
throw new ArgumentException("offset");
}
}
/// Serves as a hash function for the current object. The method is suitable for hashing algorithms and data structures like a hash table.
/// A hash value for the current object.
// Token: 0x06003555 RID: 13653 RVA: 0x000B74F0 File Offset: 0x000B56F0
public override int GetHashCode()
{
return this.Value.GetHashCode();
}
/// Returns a value that indicates whether the security identifier (SID) represented by this object is a valid Windows account SID.
/// true if the SID represented by this object is a valid Windows account SID; otherwise, false.
// Token: 0x06003556 RID: 13654 RVA: 0x000B7500 File Offset: 0x000B5700
public bool IsAccountSid()
{
throw new NotImplementedException();
}
/// Returns a value that indicates whether the security identifier (SID) represented by this object is from the same domain as the specified SID.
/// true if the SID represented by this object is in the same domain as the SID; otherwise, false.
/// The SID to compare with this object.
// Token: 0x06003557 RID: 13655 RVA: 0x000B7508 File Offset: 0x000B5708
public bool IsEqualDomainSid(SecurityIdentifier sid)
{
throw new NotImplementedException();
}
/// Returns a value that indicates whether the specified type is a valid translation type for the class.
/// true if is a valid translation type for the class; otherwise, false.
/// The type being queried for validity to serve as a conversion from . The following target types are valid:- -
// Token: 0x06003558 RID: 13656 RVA: 0x000B7510 File Offset: 0x000B5710
public override bool IsValidTargetType(Type targetType)
{
return targetType == typeof(SecurityIdentifier) || targetType == typeof(NTAccount);
}
/// Returns a value that indicates whether the object matches the specified well known security identifier (SID) type.
/// true if is the SID type for the object; otherwise, false.
/// A value to compare with the object.
// Token: 0x06003559 RID: 13657 RVA: 0x000B7538 File Offset: 0x000B5738
public bool IsWellKnown(WellKnownSidType type)
{
throw new NotImplementedException();
}
/// Returns the security identifier (SID), in Security Descriptor Definition Language (SDDL) format, for the account represented by the object. An example of the SDDL format is S-1-5-9.
/// The SID, in SDDL format, for the account represented by the object.
// Token: 0x0600355A RID: 13658 RVA: 0x000B7540 File Offset: 0x000B5740
public override string ToString()
{
return this.Value;
}
/// Translates the account name represented by the object into another -derived type.
/// The converted identity.
/// The target type for the conversion from . The target type must be a type that is considered valid by the method.
///
/// is null.
///
/// is not an type.
/// Some or all identity references could not be translated.
/// A Win32 error code was returned.
///
///
///
// Token: 0x0600355B RID: 13659 RVA: 0x000B7548 File Offset: 0x000B5748
public override IdentityReference Translate(Type targetType)
{
if (targetType == typeof(SecurityIdentifier))
{
return this;
}
return null;
}
/// Compares two objects to determine whether they are equal. They are considered equal if they have the same canonical representation as the one returned by the property or if they are both null.
/// true if and are equal; otherwise, false.
/// The left operand to use for the equality comparison. This parameter can be null.
/// The right operand to use for the equality comparison. This parameter can be null.
// Token: 0x0600355C RID: 13660 RVA: 0x000B7560 File Offset: 0x000B5760
public static bool operator ==(SecurityIdentifier left, SecurityIdentifier right)
{
if (left == null)
{
return right == null;
}
return right != null && left.Value == right.Value;
}
/// Compares two 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 property or if one of the objects is null and the other is not.
/// true if and are not equal; otherwise, false.
/// The left operand to use for the inequality comparison. This parameter can be null.
/// The right operand to use for the inequality comparison. This parameter can be null.
// Token: 0x0600355D RID: 13661 RVA: 0x000B7594 File Offset: 0x000B5794
public static bool operator !=(SecurityIdentifier left, SecurityIdentifier right)
{
if (left == null)
{
return right != null;
}
return right == null || left.Value != right.Value;
}
// Token: 0x04001599 RID: 5529
private string _value;
/// Returns the maximum size, in bytes, of the binary representation of the security identifier.
/// The maximum size, in bytes, of the binary representation of the security identifier.
// Token: 0x0400159A RID: 5530
public static readonly int MaxBinaryLength;
/// Returns the minimum size, in bytes, of the binary representation of the security identifier.
/// The minimum size, in bytes, of the binary representation of the security identifier.
// Token: 0x0400159B RID: 5531
public static readonly int MinBinaryLength;
}
}