This commit is contained in:
niko
2026-06-04 11:42:34 +02:00
parent f39ba70a9f
commit e720b98cd1
7488 changed files with 2493818 additions and 0 deletions
@@ -0,0 +1,82 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Principal
{
/// <summary>Represents a generic user.</summary>
// Token: 0x020005A9 RID: 1449
[ComVisible(true)]
[Serializable]
public class GenericIdentity : IIdentity
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Principal.GenericIdentity" /> class representing the user with the specified name and authentication type.</summary>
/// <param name="name">The name of the user on whose behalf the code is running. </param>
/// <param name="type">The type of authentication used to identify the user. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="name" /> parameter is null.-or- The <paramref name="type" /> parameter is null. </exception>
// Token: 0x06003515 RID: 13589 RVA: 0x000B6DB0 File Offset: 0x000B4FB0
public GenericIdentity(string name, string type)
{
if (name == null)
{
throw new ArgumentNullException("name");
}
if (type == null)
{
throw new ArgumentNullException("type");
}
this.m_name = name;
this.m_type = type;
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Principal.GenericIdentity" /> class representing the user with the specified name.</summary>
/// <param name="name">The name of the user on whose behalf the code is running. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="name" /> parameter is null. </exception>
// Token: 0x06003516 RID: 13590 RVA: 0x000B6DF4 File Offset: 0x000B4FF4
public GenericIdentity(string name)
: this(name, string.Empty)
{
}
/// <summary>Gets the type of authentication used to identify the user.</summary>
/// <returns>The type of authentication used to identify the user.</returns>
// Token: 0x17000A66 RID: 2662
// (get) Token: 0x06003517 RID: 13591 RVA: 0x000B6E04 File Offset: 0x000B5004
public virtual string AuthenticationType
{
get
{
return this.m_type;
}
}
/// <summary>Gets the user's name.</summary>
/// <returns>The name of the user on whose behalf the code is being run.</returns>
// Token: 0x17000A67 RID: 2663
// (get) Token: 0x06003518 RID: 13592 RVA: 0x000B6E0C File Offset: 0x000B500C
public virtual string Name
{
get
{
return this.m_name;
}
}
/// <summary>Gets a value indicating whether the user has been authenticated.</summary>
/// <returns>true if the user was has been authenticated; otherwise, false.</returns>
// Token: 0x17000A68 RID: 2664
// (get) Token: 0x06003519 RID: 13593 RVA: 0x000B6E14 File Offset: 0x000B5014
public virtual bool IsAuthenticated
{
get
{
return this.m_name.Length > 0;
}
}
// Token: 0x0400158E RID: 5518
private string m_name;
// Token: 0x0400158F RID: 5519
private string m_type;
}
}
@@ -0,0 +1,73 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Principal
{
/// <summary>Represents a generic principal.</summary>
// Token: 0x020005AA RID: 1450
[ComVisible(true)]
[Serializable]
public class GenericPrincipal : IPrincipal
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Principal.GenericPrincipal" /> class from a user identity and an array of role names to which the user represented by that identity belongs.</summary>
/// <param name="identity">A basic implementation of <see cref="T:System.Security.Principal.IIdentity" /> that represents any user. </param>
/// <param name="roles">An array of role names to which the user represented by the <paramref name="identity" /> parameter belongs. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="identity" /> parameter is null. </exception>
// Token: 0x0600351A RID: 13594 RVA: 0x000B6E24 File Offset: 0x000B5024
public GenericPrincipal(IIdentity identity, string[] roles)
{
if (identity == null)
{
throw new ArgumentNullException("identity");
}
this.m_identity = identity;
if (roles != null)
{
this.m_roles = new string[roles.Length];
for (int i = 0; i < roles.Length; i++)
{
this.m_roles[i] = roles[i];
}
}
}
/// <summary>Gets the <see cref="T:System.Security.Principal.GenericIdentity" /> of the user represented by the current <see cref="T:System.Security.Principal.GenericPrincipal" />.</summary>
/// <returns>The <see cref="T:System.Security.Principal.GenericIdentity" /> of the user represented by the <see cref="T:System.Security.Principal.GenericPrincipal" />.</returns>
// Token: 0x17000A69 RID: 2665
// (get) Token: 0x0600351B RID: 13595 RVA: 0x000B6E84 File Offset: 0x000B5084
public virtual IIdentity Identity
{
get
{
return this.m_identity;
}
}
/// <summary>Determines whether the current <see cref="T:System.Security.Principal.GenericPrincipal" /> belongs to the specified role.</summary>
/// <returns>true if the current <see cref="T:System.Security.Principal.GenericPrincipal" /> is a member of the specified role; otherwise, false.</returns>
/// <param name="role">The name of the role for which to check membership. </param>
// Token: 0x0600351C RID: 13596 RVA: 0x000B6E8C File Offset: 0x000B508C
public virtual bool IsInRole(string role)
{
if (this.m_roles == null)
{
return false;
}
int length = role.Length;
foreach (string text in this.m_roles)
{
if (text != null && length == text.Length && string.Compare(role, 0, text, 0, length, true) == 0)
{
return true;
}
}
return false;
}
// Token: 0x04001590 RID: 5520
private IIdentity m_identity;
// Token: 0x04001591 RID: 5521
private string[] m_roles;
}
}
@@ -0,0 +1,29 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Principal
{
/// <summary>Defines the basic functionality of an identity object.</summary>
// Token: 0x020005AB RID: 1451
[ComVisible(true)]
public interface IIdentity
{
/// <summary>Gets the type of authentication used.</summary>
/// <returns>The type of authentication used to identify the user.</returns>
// Token: 0x17000A6A RID: 2666
// (get) Token: 0x0600351D RID: 13597
string AuthenticationType { get; }
/// <summary>Gets a value that indicates whether the user has been authenticated.</summary>
/// <returns>true if the user was authenticated; otherwise, false.</returns>
// Token: 0x17000A6B RID: 2667
// (get) Token: 0x0600351E RID: 13598
bool IsAuthenticated { get; }
/// <summary>Gets the name of the current user.</summary>
/// <returns>The name of the user on whose behalf the code is running.</returns>
// Token: 0x17000A6C RID: 2668
// (get) Token: 0x0600351F RID: 13599
string Name { get; }
}
}
@@ -0,0 +1,23 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Principal
{
/// <summary>Defines the basic functionality of a principal object.</summary>
// Token: 0x020005AC RID: 1452
[ComVisible(true)]
public interface IPrincipal
{
/// <summary>Gets the identity of the current principal.</summary>
/// <returns>The <see cref="T:System.Security.Principal.IIdentity" /> object associated with the current principal.</returns>
// Token: 0x17000A6D RID: 2669
// (get) Token: 0x06003520 RID: 13600
IIdentity Identity { get; }
/// <summary>Determines whether the current principal belongs to the specified role.</summary>
/// <returns>true if the current principal is a member of the specified role; otherwise, false.</returns>
/// <param name="role">The name of the role for which to check membership. </param>
// Token: 0x06003521 RID: 13601
bool IsInRole(string role);
}
}
@@ -0,0 +1,65 @@
using System;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
namespace System.Security.Principal
{
/// <summary>Represents an exception for a principal whose identity could not be mapped to a known identity.</summary>
// Token: 0x020005AD RID: 1453
[ComVisible(false)]
[Serializable]
public sealed class IdentityNotMappedException : SystemException
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Principal.IdentityNotMappedException" /> class.</summary>
// Token: 0x06003522 RID: 13602 RVA: 0x000B6EF4 File Offset: 0x000B50F4
public IdentityNotMappedException()
: base(Locale.GetText("Couldn't translate some identities."))
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Principal.IdentityNotMappedException" /> class by using the specified error message.</summary>
/// <param name="message">The error message that explains the reason for the exception.</param>
// Token: 0x06003523 RID: 13603 RVA: 0x000B6F08 File Offset: 0x000B5108
public IdentityNotMappedException(string message)
: base(message)
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Principal.IdentityNotMappedException" /> class by using the specified error message and inner exception.</summary>
/// <param name="message">The error message that explains the reason for the exception.</param>
/// <param name="inner">The exception that is the cause of the current exception. If <paramref name="inner" /> is not null, the current exception is raised in a catch block that handles the inner exception.</param>
// Token: 0x06003524 RID: 13604 RVA: 0x000B6F14 File Offset: 0x000B5114
public IdentityNotMappedException(string message, Exception inner)
: base(message, inner)
{
}
/// <summary>Represents the collection of unmapped identities for an <see cref="T:System.Security.Principal.IdentityNotMappedException" /> exception.</summary>
/// <returns>The collection of unmapped identities.</returns>
// Token: 0x17000A6E RID: 2670
// (get) Token: 0x06003525 RID: 13605 RVA: 0x000B6F20 File Offset: 0x000B5120
public IdentityReferenceCollection UnmappedIdentities
{
get
{
if (this._coll == null)
{
this._coll = new IdentityReferenceCollection();
}
return this._coll;
}
}
/// <summary>Gets serialization information with the data needed to create an instance of this <see cref="T:System.Security.Principal.IdentityNotMappedException" /> object. </summary>
/// <param name="serializationInfo">The <see cref="T:System.Runtime.Serialization." /><see cref="SerializationInfo object" /> that holds the serialized object data about the exception being thrown.</param>
/// <param name="streamingContext">The <see cref="T:System.Runtime.SerializationInfo." /><see cref="StreamingContext" /> object that contains contextual information about the source or destination.</param>
// Token: 0x06003526 RID: 13606 RVA: 0x000B6F40 File Offset: 0x000B5140
[MonoTODO("not implemented")]
public override void GetObjectData(SerializationInfo serializationInfo, StreamingContext streamingContext)
{
}
// Token: 0x04001592 RID: 5522
private IdentityReferenceCollection _coll;
}
}
@@ -0,0 +1,78 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Principal
{
/// <summary>Represents an identity and is the base class for the <see cref="T:System.Security.Principal.NTAccount" /> and <see cref="T:System.Security.Principal.SecurityIdentifier" /> classes. This class does not provide a public constructor, and therefore cannot be inherited.</summary>
// Token: 0x020005AE RID: 1454
[ComVisible(false)]
public abstract class IdentityReference
{
// Token: 0x06003527 RID: 13607 RVA: 0x000B6F44 File Offset: 0x000B5144
internal IdentityReference()
{
}
/// <summary>Gets the string value of the identity represented by the <see cref="T:System.Security.Principal.IdentityReference" /> object.</summary>
/// <returns>The string value of the identity represented by the <see cref="T:System.Security.Principal.IdentityReference" /> object.</returns>
// Token: 0x17000A6F RID: 2671
// (get) Token: 0x06003528 RID: 13608
public abstract string Value { get; }
/// <summary>Returns a value that indicates whether the specified object equals this instance of the <see cref="T:System.Security.Principal.IdentityReference" /> class.</summary>
/// <returns>true if <paramref name="o" /> is an object with the same underlying type and value as this <see cref="T:System.Security.Principal.IdentityReference" /> instance; otherwise, false.</returns>
/// <param name="o">An object to compare with this <see cref="T:System.Security.Principal.IdentityReference" /> instance, or a null reference.</param>
// Token: 0x06003529 RID: 13609
public abstract override bool Equals(object o);
/// <summary>Serves as a hash function for <see cref="T:System.Security.Principal.IdentityReference" />. <see cref="M:System.Security.Principal.IdentityReference.GetHashCode" /> is suitable for use in hashing algorithms and data structures like a hash table.</summary>
/// <returns>The hash code for this <see cref="T:System.Security.Principal.IdentityReference" /> object.</returns>
// Token: 0x0600352A RID: 13610
public abstract override int GetHashCode();
/// <summary>Returns a value that indicates whether the specified type is a valid translation type for the <see cref="T:System.Security.Principal.IdentityReference" /> class.</summary>
/// <returns>true if <paramref name="targetType" /> is a valid translation type for the <see cref="T:System.Security.Principal.IdentityReference" /> class; otherwise, false.</returns>
/// <param name="targetType">The type being queried for validity to serve as a conversion from <see cref="T:System.Security.Principal.IdentityReference" />. The following target types are valid:<see cref="T:System.Security.Principal.NTAccount" /><see cref="T:System.Security.Principal.SecurityIdentifier" /></param>
// Token: 0x0600352B RID: 13611
public abstract bool IsValidTargetType(Type targetType);
/// <summary>Returns the string representation of the identity represented by the <see cref="T:System.Security.Principal.IdentityReference" /> object.</summary>
/// <returns>The identity in string format.</returns>
// Token: 0x0600352C RID: 13612
public abstract override string ToString();
/// <summary>Translates the account name represented by the <see cref="T:System.Security.Principal.IdentityReference" /> object into another <see cref="T:System.Security.Principal.IdentityReference" />-derived type.</summary>
/// <returns>The converted identity.</returns>
/// <param name="targetType">The target type for the conversion from <see cref="T:System.Security.Principal.IdentityReference" />. </param>
// Token: 0x0600352D RID: 13613
public abstract IdentityReference Translate(Type targetType);
/// <summary>Compares two <see cref="T:System.Security.Principal.IdentityReference" /> objects to determine whether they are equal. They are considered equal if they have the same canonical name representation as the one returned by the <see cref="P:System.Security.Principal.IdentityReference.Value" /> property or if they are both null.</summary>
/// <returns>true if <paramref name="left" /> and <paramref name="right" /> are equal; otherwise, false.</returns>
/// <param name="left">The left <see cref="T:System.Security.Principal.IdentityReference" /> operand to use for the equality comparison. This parameter can be null.</param>
/// <param name="right">The right <see cref="T:System.Security.Principal.IdentityReference" /> operand to use for the equality comparison. This parameter can be null.</param>
// Token: 0x0600352E RID: 13614 RVA: 0x000B6F4C File Offset: 0x000B514C
public static bool operator ==(IdentityReference left, IdentityReference right)
{
if (left == null)
{
return right == null;
}
return right != null && left.Value == right.Value;
}
/// <summary>Compares two <see cref="T:System.Security.Principal.IdentityReference" /> 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 <see cref="P:System.Security.Principal.IdentityReference.Value" /> property or if one of the objects is null and the other is not.</summary>
/// <returns>true if <paramref name="left" /> and <paramref name="right" /> are not equal; otherwise, false.</returns>
/// <param name="left">The left <see cref="T:System.Security.Principal.IdentityReference" /> operand to use for the inequality comparison. This parameter can be null.</param>
/// <param name="right">The right <see cref="T:System.Security.Principal.IdentityReference" /> operand to use for the inequality comparison. This parameter can be null.</param>
// Token: 0x0600352F RID: 13615 RVA: 0x000B6F80 File Offset: 0x000B5180
public static bool operator !=(IdentityReference left, IdentityReference right)
{
if (left == null)
{
return right != null;
}
return right == null || left.Value != right.Value;
}
}
}
@@ -0,0 +1,175 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
namespace System.Security.Principal
{
/// <summary>Represents a collection of <see cref="T:System.Security.Principal.IdentityReference" /> objects and provides a means of converting sets of <see cref="T:System.Security.Principal.IdentityReference" />-derived objects to <see cref="T:System.Security.Principal.IdentityReference" />-derived types. </summary>
// Token: 0x020005AF RID: 1455
[ComVisible(false)]
public class IdentityReferenceCollection : IEnumerable, ICollection<IdentityReference>, IEnumerable<IdentityReference>
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Principal.IdentityReferenceCollection" /> class with zero items in the collection.</summary>
// Token: 0x06003530 RID: 13616 RVA: 0x000B6FB4 File Offset: 0x000B51B4
public IdentityReferenceCollection()
{
this._list = new ArrayList();
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Principal.IdentityReferenceCollection" /> class by using the specified initial size.</summary>
/// <param name="capacity">The initial number of items in the collection. The value of <paramref name="capacity" /> is a hint only; it is not necessarily the maximum number of items created.</param>
// Token: 0x06003531 RID: 13617 RVA: 0x000B6FC8 File Offset: 0x000B51C8
public IdentityReferenceCollection(int capacity)
{
this._list = new ArrayList(capacity);
}
/// <summary>Gets an enumerator that can be used to iterate through the <see cref="T:System.Security.Principal.IdentityReferenceCollection" /> collection.</summary>
/// <returns>An enumerator for the <see cref="T:System.Security.Principal.IdentityReferenceCollection" /> collection.</returns>
// Token: 0x06003532 RID: 13618 RVA: 0x000B6FDC File Offset: 0x000B51DC
IEnumerator IEnumerable.GetEnumerator()
{
throw new NotImplementedException();
}
/// <summary>Gets the number of items in the <see cref="T:System.Security.Principal.IdentityReferenceCollection" /> collection.</summary>
/// <returns>The number of <see cref="T:System.Security.Principal.IdentityReference" /> objects in the <see cref="T:System.Security.Principal.IdentityReferenceCollection" /> collection.</returns>
// Token: 0x17000A70 RID: 2672
// (get) Token: 0x06003533 RID: 13619 RVA: 0x000B6FE4 File Offset: 0x000B51E4
public int Count
{
get
{
return this._list.Count;
}
}
/// <summary>Gets a value that indicates whether the <see cref="T:System.Security.Principal.IdentityReferenceCollection" /> collection is read-only.</summary>
/// <returns>true if the <see cref="T:System.Security.Principal.IdentityReferenceCollection" /> collection is read-only.</returns>
// Token: 0x17000A71 RID: 2673
// (get) Token: 0x06003534 RID: 13620 RVA: 0x000B6FF4 File Offset: 0x000B51F4
public bool IsReadOnly
{
get
{
return false;
}
}
/// <summary>Sets or gets the node at the specified index of the <see cref="T:System.Security.Principal.IdentityReferenceCollection" /> collection.</summary>
/// <returns>The <see cref="T:System.Security.Principal.IdentityReference" /> at the specified index in the collection. If <paramref name="index" /> is greater than or equal to the number of nodes in the collection, the return value is null.</returns>
/// <param name="index">The zero-based index in the <see cref="T:System.Security.Principal.IdentityReferenceCollection" /> collection.</param>
// Token: 0x17000A72 RID: 2674
public IdentityReference this[int index]
{
get
{
if (index >= this._list.Count)
{
return null;
}
return (IdentityReference)this._list[index];
}
set
{
this._list[index] = value;
}
}
/// <summary>Adds an <see cref="T:System.Security.Principal.IdentityReference" /> object to the <see cref="T:System.Security.Principal.IdentityReferenceCollection" /> collection.</summary>
/// <param name="identity">The <see cref="T:System.Security.Principal.IdentityReference" /> object to add to the collection.</param>
// Token: 0x06003537 RID: 13623 RVA: 0x000B703C File Offset: 0x000B523C
public void Add(IdentityReference identity)
{
this._list.Add(identity);
}
/// <summary>Clears all <see cref="T:System.Security.Principal.IdentityReference" /> objects from the <see cref="T:System.Security.Principal.IdentityReferenceCollection" /> collection.</summary>
// Token: 0x06003538 RID: 13624 RVA: 0x000B704C File Offset: 0x000B524C
public void Clear()
{
this._list.Clear();
}
/// <summary>Indicates whether the <see cref="T:System.Security.Principal.IdentityReferenceCollection" /> collection contains the specified <see cref="T:System.Security.Principal.IdentityReference" /> object.</summary>
/// <returns>true if the collection contains the specified object.</returns>
/// <param name="identity">The <see cref="T:System.Security.Principal.IdentityReference" /> object to check for.</param>
// Token: 0x06003539 RID: 13625 RVA: 0x000B705C File Offset: 0x000B525C
public bool Contains(IdentityReference identity)
{
foreach (object obj in this._list)
{
IdentityReference identityReference = (IdentityReference)obj;
if (identityReference.Equals(identity))
{
return true;
}
}
return false;
}
/// <summary>Copies the <see cref="T:System.Security.Principal.IdentityReferenceCollection" /> collection to an <see cref="T:System.Security.Principal.IdentityReferenceCollection" /> array, starting at the specified index.</summary>
/// <param name="array">An <see cref="T:System.Security.Principal.IdentityReferenceCollection" /> array object to which the <see cref="T:System.Security.Principal.IdentityReferenceCollection" /> collection is to be copied.</param>
/// <param name="offset">The zero-based index in <paramref name="array" /> where the <see cref="T:System.Security.Principal.IdentityReferenceCollection" /> collection is to be copied.</param>
// Token: 0x0600353A RID: 13626 RVA: 0x000B70DC File Offset: 0x000B52DC
public void CopyTo(IdentityReference[] array, int offset)
{
throw new NotImplementedException();
}
/// <summary>Gets an enumerator that can be used to iterate through the <see cref="T:System.Security.Principal.IdentityReferenceCollection" /> collection.</summary>
/// <returns>An enumerator for the <see cref="T:System.Security.Principal.IdentityReferenceCollection" /> collection.</returns>
// Token: 0x0600353B RID: 13627 RVA: 0x000B70E4 File Offset: 0x000B52E4
public IEnumerator<IdentityReference> GetEnumerator()
{
throw new NotImplementedException();
}
/// <summary>Removes the specified <see cref="T:System.Security.Principal.IdentityReference" /> object from the collection.</summary>
/// <returns>true if the specified object was removed from the collection.</returns>
/// <param name="identity">The <see cref="T:System.Security.Principal.IdentityReference" /> object to remove.</param>
// Token: 0x0600353C RID: 13628 RVA: 0x000B70EC File Offset: 0x000B52EC
public bool Remove(IdentityReference identity)
{
foreach (object obj in this._list)
{
IdentityReference identityReference = (IdentityReference)obj;
if (identityReference.Equals(identity))
{
this._list.Remove(identityReference);
return true;
}
}
return false;
}
/// <summary>Converts the objects in the collection to the specified type. Calling this method is the same as calling <see cref="M:System.Security.Principal.IdentityReferenceCollection.Translate(System.Type,System.Boolean)" /> with the second parameter set to false, which means that exceptions will not be thrown for items that fail conversion.</summary>
/// <returns>A <see cref="T:System.Security.Principal.IdentityReferenceCollection" /> collection that represents the converted contents of the original collection.</returns>
/// <param name="targetType">The type to which items in the collection are being converted.</param>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="MemberAccess" />
/// </PermissionSet>
// Token: 0x0600353D RID: 13629 RVA: 0x000B7178 File Offset: 0x000B5378
public IdentityReferenceCollection Translate(Type targetType)
{
throw new NotImplementedException();
}
/// <summary>Converts the objects in the collection to the specified type and uses the specified fault tolerance to handle or ignore errors associated with a type not having a conversion mapping.</summary>
/// <returns>A <see cref="T:System.Security.Principal.IdentityReferenceCollection" /> collection that represents the converted contents of the original collection.</returns>
/// <param name="targetType">The type to which items in the collection are being converted.</param>
/// <param name="forceSuccess">A Boolean value that determines how conversion errors are handled.If <paramref name="forceSuccess" /> is true, conversion errors due to a mapping not being found for the translation result in a failed conversion and exceptions being thrown.If <paramref name="forceSuccess" /> is false, types that failed to convert due to a mapping not being found for the translation are copied without being converted into the collection being returned.</param>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="MemberAccess" />
/// </PermissionSet>
// Token: 0x0600353E RID: 13630 RVA: 0x000B7180 File Offset: 0x000B5380
public IdentityReferenceCollection Translate(Type targetType, bool forceSuccess)
{
throw new NotImplementedException();
}
// Token: 0x04001593 RID: 5523
private ArrayList _list;
}
}
@@ -0,0 +1,154 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Principal
{
/// <summary>Represents a user or group account.</summary>
// Token: 0x020005B0 RID: 1456
[ComVisible(false)]
public sealed class NTAccount : IdentityReference
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Principal.NTAccount" /> class by using the specified name.</summary>
/// <param name="name">The name used to create the <see cref="T:System.Security.Principal.NTAccount" /> object. This parameter cannot be null or an empty string.</param>
// Token: 0x0600353F RID: 13631 RVA: 0x000B7188 File Offset: 0x000B5388
public NTAccount(string name)
{
if (name == null)
{
throw new ArgumentNullException("name");
}
if (name.Length == 0)
{
throw new ArgumentException(Locale.GetText("Empty"), "name");
}
this._value = name.ToUpper();
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Principal.NTAccount" /> class by using the specified domain name and account name. </summary>
/// <param name="domainName">The name of the domain. This parameter can be null or an empty string. Domain names that are null values are treated like an empty string.</param>
/// <param name="accountName">The name of the account. This parameter cannot be null or an empty string.</param>
// Token: 0x06003540 RID: 13632 RVA: 0x000B71D8 File Offset: 0x000B53D8
public NTAccount(string domainName, string accountName)
{
if (accountName == null)
{
throw new ArgumentNullException("accountName");
}
if (accountName.Length == 0)
{
throw new ArgumentException(Locale.GetText("Empty"), "accountName");
}
if (domainName == null)
{
this._value = domainName.ToUpper();
}
else
{
this._value = domainName.ToUpper() + "\\" + domainName.ToUpper();
}
}
/// <summary>Returns an uppercase string representation of this <see cref="T:System.Security.Principal.NTAccount" /> object.</summary>
/// <returns>The uppercase string representation of this <see cref="T:System.Security.Principal.NTAccount" /> object.</returns>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x17000A73 RID: 2675
// (get) Token: 0x06003541 RID: 13633 RVA: 0x000B7250 File Offset: 0x000B5450
public override string Value
{
get
{
return this._value;
}
}
/// <summary>Returns a value that indicates whether this <see cref="T:System.Security.Principal.NTAccount" /> object is equal to a specified object.</summary>
/// <returns>true if <paramref name="o" /> is an object with the same underlying type and value as this <see cref="T:System.Security.Principal.NTAccount" /> object; otherwise, false.</returns>
/// <param name="o">An object to compare with this <see cref="T:System.Security.Principal.NTAccount" /> object, or null.</param>
// Token: 0x06003542 RID: 13634 RVA: 0x000B7258 File Offset: 0x000B5458
public override bool Equals(object o)
{
NTAccount ntaccount = o as NTAccount;
return !(ntaccount == null) && ntaccount.Value == this.Value;
}
/// <summary>Serves as a hash function for the current <see cref="T:System.Security.Principal.NTAccount" /> object. The <see cref="M:System.Security.Principal.NTAccount.GetHashCode" /> method is suitable for hashing algorithms and data structures like a hash table.</summary>
/// <returns>A hash value for the current <see cref="T:System.Security.Principal.NTAccount" /> object.</returns>
// Token: 0x06003543 RID: 13635 RVA: 0x000B728C File Offset: 0x000B548C
public override int GetHashCode()
{
return this.Value.GetHashCode();
}
/// <summary>Returns a value that indicates whether the specified type is a valid translation type for the <see cref="T:System.Security.Principal.NTAccount" /> class.</summary>
/// <returns>true if <paramref name="targetType" /> is a valid translation type for the <see cref="T:System.Security.Principal.NTAccount" /> class; otherwise false.</returns>
/// <param name="targetType">The type being queried for validity to serve as a conversion from <see cref="T:System.Security.Principal.NTAccount" />. The following target types are valid:- <see cref="T:System.Security.Principal.NTAccount" />- <see cref="T:System.Security.Principal.SecurityIdentifier" /></param>
// Token: 0x06003544 RID: 13636 RVA: 0x000B729C File Offset: 0x000B549C
public override bool IsValidTargetType(Type targetType)
{
return targetType == typeof(NTAccount) || targetType == typeof(SecurityIdentifier);
}
/// <summary>Returns the account name, in Domain\Account format, for the account represented by the <see cref="T:System.Security.Principal.NTAccount" /> object.</summary>
/// <returns>The account name, in Domain\Account format.</returns>
// Token: 0x06003545 RID: 13637 RVA: 0x000B72C4 File Offset: 0x000B54C4
public override string ToString()
{
return this.Value;
}
/// <summary>Translates the account name represented by the <see cref="T:System.Security.Principal.NTAccount" /> object into another <see cref="T:System.Security.Principal.IdentityReference" />-derived type.</summary>
/// <returns>The converted identity.</returns>
/// <param name="targetType">The target type for the conversion from <see cref="T:System.Security.Principal.NTAccount" />. The target type must be a type that is considered valid by the <see cref="M:System.Security.Principal.NTAccount.IsValidTargetType(System.Type)" /> method. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="targetType " />is null.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="targetType " />is not an <see cref="T:System.Security.Principal.IdentityReference" /> type.</exception>
/// <exception cref="T:System.Security.Principal.IdentityNotMappedException">Some or all identity references could not be translated.</exception>
/// <exception cref="T:System.SystemException">The source account name is too long.-or-A Win32 error code was returned.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="MemberAccess" />
/// </PermissionSet>
// Token: 0x06003546 RID: 13638 RVA: 0x000B72CC File Offset: 0x000B54CC
public override IdentityReference Translate(Type targetType)
{
if (targetType == typeof(NTAccount))
{
return this;
}
return null;
}
/// <summary>Compares two <see cref="T:System.Security.Principal.NTAccount" /> objects to determine whether they are equal. They are considered equal if they have the same canonical name representation as the one returned by the <see cref="P:System.Security.Principal.NTAccount.Value" /> property or if they are both null. </summary>
/// <returns>true if <paramref name="left" /> and <paramref name="right" /> are equal; otherwise false.</returns>
/// <param name="left">The left operand to use for the equality comparison. This parameter can be null.</param>
/// <param name="right">The right operand to use for the equality comparison. This parameter can be null.</param>
// Token: 0x06003547 RID: 13639 RVA: 0x000B72E4 File Offset: 0x000B54E4
public static bool operator ==(NTAccount left, NTAccount right)
{
if (left == null)
{
return right == null;
}
return right != null && left.Value == right.Value;
}
/// <summary>Compares two <see cref="T:System.Security.Principal.NTAccount" /> 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 <see cref="P:System.Security.Principal.NTAccount.Value" /> property or if one of the objects is null and the other is not.</summary>
/// <returns>true if <paramref name="left" /> and <paramref name="right" /> are not equal; otherwise false.</returns>
/// <param name="left">The left operand to use for the inequality comparison. This parameter can be null.</param>
/// <param name="right">The right operand to use for the inequality comparison. This parameter can be null.</param>
// Token: 0x06003548 RID: 13640 RVA: 0x000B7318 File Offset: 0x000B5518
public static bool operator !=(NTAccount left, NTAccount right)
{
if (left == null)
{
return right != null;
}
return right == null || left.Value != right.Value;
}
// Token: 0x04001594 RID: 5524
private string _value;
}
}
@@ -0,0 +1,22 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Principal
{
/// <summary>Specifies how principal and identity objects should be created for an application domain. The default is UnauthenticatedPrincipal.</summary>
// Token: 0x020005B1 RID: 1457
[ComVisible(true)]
[Serializable]
public enum PrincipalPolicy
{
/// <summary>Principal and identity objects for the unauthenticated entity should be created. An unauthenticated entity has <see cref="P:System.Security.Principal.GenericIdentity.Name" /> set to the empty string ("") and <see cref="P:System.Security.Principal.GenericIdentity.IsAuthenticated" /> set to false.</summary>
// Token: 0x04001596 RID: 5526
UnauthenticatedPrincipal,
/// <summary>No principal or identity objects should be created.</summary>
// Token: 0x04001597 RID: 5527
NoPrincipal,
/// <summary>Principal and identity objects that reflect the operating system token associated with the current execution thread should be created, and the associated operating system groups should be mapped into roles.</summary>
// Token: 0x04001598 RID: 5528
WindowsPrincipal
}
}
@@ -0,0 +1,280 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Principal
{
/// <summary>Represents a security identifier (SID) and provides marshaling and comparison operations for SIDs.</summary>
// Token: 0x020005B2 RID: 1458
[MonoTODO("not implemented")]
[ComVisible(false)]
public sealed class SecurityIdentifier : IdentityReference, IComparable<SecurityIdentifier>
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Principal.SecurityIdentifier" /> class by using the specified security identifier (SID) in Security Descriptor Definition Language (SDDL) format.</summary>
/// <param name="sddlForm">SDDL string for the SID used to created the <see cref="T:System.Security.Principal.SecurityIdentifier" /> object.</param>
// Token: 0x06003549 RID: 13641 RVA: 0x000B734C File Offset: 0x000B554C
public SecurityIdentifier(string sddlForm)
{
if (sddlForm == null)
{
throw new ArgumentNullException("sddlForm");
}
this._value = sddlForm.ToUpperInvariant();
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Principal.SecurityIdentifier" /> class by using a specified binary representation of a security identifier (SID).</summary>
/// <param name="binaryForm">The byte array that represents the SID.</param>
/// <param name="offset">The byte offset to use as the starting index in <paramref name="binaryForm" />. </param>
// 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();
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Principal.SecurityIdentifier" /> class by using an integer that represents the binary form of a security identifier (SID).</summary>
/// <param name="binaryForm">An integer that represents the binary form of a SID.</param>
// Token: 0x0600354B RID: 13643 RVA: 0x000B73B0 File Offset: 0x000B55B0
public SecurityIdentifier(IntPtr binaryForm)
{
throw new NotImplementedException();
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Principal.SecurityIdentifier" /> class by using the specified well known security identifier (SID) type and domain SID.</summary>
/// <param name="sidType">A <see cref="T:System.Security.Principal.WellKnownSidType" /> value.This value must not be <see cref="F:System.Security.Principal.WellKnownSidType.WinLogonIdsSid" />.</param>
/// <param name="domainSid">The domain SID. This value is required for the following <see cref="T:System.Security.Principal.WellKnownSidType" /> values. This parameter is ignored for any other <see cref="T:System.Security.Principal.WellKnownSidType" /> values.- <see cref="F:System.Security.Principal.WellKnownSidType.AccountAdministratorSid" />- <see cref="F:System.Security.Principal.WellKnownSidType.AccountGuestSid" />- <see cref="F:System.Security.Principal.WellKnownSidType.AccountKrbtgtSid" />- <see cref="F:System.Security.Principal.WellKnownSidType.AccountDomainAdminsSid" />- <see cref="F:System.Security.Principal.WellKnownSidType.AccountDomainUsersSid" />- <see cref="F:System.Security.Principal.WellKnownSidType.AccountDomainGuestsSid" />- <see cref="F:System.Security.Principal.WellKnownSidType.AccountComputersSid" />- <see cref="F:System.Security.Principal.WellKnownSidType.AccountControllersSid" />- <see cref="F:System.Security.Principal.WellKnownSidType.AccountCertAdminsSid" />- <see cref="F:System.Security.Principal.WellKnownSidType.AccountSchemaAdminsSid" />- <see cref="F:System.Security.Principal.WellKnownSidType.AccountEnterpriseAdminsSid" />- <see cref="F:System.Security.Principal.WellKnownSidType.AccountPolicyAdminsSid" />- <see cref="F:System.Security.Principal.WellKnownSidType.AccountRasAndIasServersSid" /></param>
// 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;
}
}
/// <summary>Returns the account domain security identifier (SID) portion from the SID represented by the <see cref="T:System.Security.Principal.SecurityIdentifier" /> object if the SID represents a Windows account SID. If the SID does not represent a Windows account SID, this property returns <see cref="T:System.ArgumentNullException" />.</summary>
/// <returns>The account domain SID portion from the SID represented by the <see cref="T:System.Security.Principal.SecurityIdentifier" /> object if the SID represents a Windows account SID; otherwise, it returns <see cref="T:System.ArgumentNullException" />.</returns>
// Token: 0x17000A74 RID: 2676
// (get) Token: 0x0600354E RID: 13646 RVA: 0x000B7450 File Offset: 0x000B5650
public SecurityIdentifier AccountDomainSid
{
get
{
throw new ArgumentNullException("AccountDomainSid");
}
}
/// <summary>Returns the length, in bytes, of the security identifier (SID) represented by the <see cref="T:System.Security.Principal.SecurityIdentifier" /> object.</summary>
/// <returns>The length, in bytes, of the SID represented by the <see cref="T:System.Security.Principal.SecurityIdentifier" /> object.</returns>
// Token: 0x17000A75 RID: 2677
// (get) Token: 0x0600354F RID: 13647 RVA: 0x000B745C File Offset: 0x000B565C
public int BinaryLength
{
get
{
return -1;
}
}
/// <summary>Returns an uppercase Security Descriptor Definition Language (SDDL) string for the security identifier (SID) represented by this <see cref="T:System.Security.Principal.SecurityIdentifier" /> object.</summary>
/// <returns>An uppercase SDDL string for the SID represented by the <see cref="T:System.Security.Principal.SecurityIdentifier" /> object.</returns>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x17000A76 RID: 2678
// (get) Token: 0x06003550 RID: 13648 RVA: 0x000B7460 File Offset: 0x000B5660
public override string Value
{
get
{
return this._value;
}
}
/// <summary>Compares the current <see cref="T:System.Security.Principal.SecurityIdentifier" /> object with the specified <see cref="T:System.Security.Principal.SecurityIdentifier" /> object.</summary>
/// <returns>A signed number indicating the relative values of this instance and <paramref name="sid" />.Return Value Description Less than zero This instance is less than <paramref name="sid" />. Zero This instance is equal to <paramref name="sid" />. Greater than zero This instance is greater than <paramref name="sid" />. </returns>
/// <param name="sid">The object to compare with the current object.</param>
// Token: 0x06003551 RID: 13649 RVA: 0x000B7468 File Offset: 0x000B5668
public int CompareTo(SecurityIdentifier sid)
{
return this.Value.CompareTo(sid.Value);
}
/// <summary>Returns a value that indicates whether this <see cref="T:System.Security.Principal.SecurityIdentifier" /> object is equal to a specified object.</summary>
/// <returns>true if <paramref name="o" /> is an object with the same underlying type and value as this <see cref="T:System.Security.Principal.SecurityIdentifier" /> object; otherwise, false.</returns>
/// <param name="o">An object to compare with this <see cref="T:System.Security.Principal.SecurityIdentifier" /> object, or null.</param>
// Token: 0x06003552 RID: 13650 RVA: 0x000B747C File Offset: 0x000B567C
public override bool Equals(object o)
{
return this.Equals(o as SecurityIdentifier);
}
/// <summary>Indicates whether the specified <see cref="T:System.Security.Principal.SecurityIdentifier" /> object is equal to the current <see cref="T:System.Security.Principal.SecurityIdentifier" /> object.</summary>
/// <returns>true if the value of <paramref name="sid" /> is equal to the value of the current <see cref="T:System.Security.Principal.SecurityIdentifier" /> object.</returns>
/// <param name="sid">The object to compare with the current object.</param>
// Token: 0x06003553 RID: 13651 RVA: 0x000B748C File Offset: 0x000B568C
public bool Equals(SecurityIdentifier sid)
{
return !(sid == null) && sid.Value == this.Value;
}
/// <summary>Copies the binary representation of the specified security identifier (SID) represented by the <see cref="T:System.Security.Principal.SecurityIdentifier" /> class to a byte array.</summary>
/// <param name="binaryForm">The byte array to receive the copied SID.</param>
/// <param name="offset">The byte offset to use as the starting index in <paramref name="binaryForm" />. </param>
// 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");
}
}
/// <summary>Serves as a hash function for the current <see cref="T:System.Security.Principal.SecurityIdentifier" /> object. The <see cref="M:System.Security.Principal.SecurityIdentifier.GetHashCode" /> method is suitable for hashing algorithms and data structures like a hash table.</summary>
/// <returns>A hash value for the current <see cref="T:System.Security.Principal.SecurityIdentifier" /> object.</returns>
// Token: 0x06003555 RID: 13653 RVA: 0x000B74F0 File Offset: 0x000B56F0
public override int GetHashCode()
{
return this.Value.GetHashCode();
}
/// <summary>Returns a value that indicates whether the security identifier (SID) represented by this <see cref="T:System.Security.Principal.SecurityIdentifier" /> object is a valid Windows account SID.</summary>
/// <returns>true if the SID represented by this <see cref="T:System.Security.Principal.SecurityIdentifier" /> object is a valid Windows account SID; otherwise, false.</returns>
// Token: 0x06003556 RID: 13654 RVA: 0x000B7500 File Offset: 0x000B5700
public bool IsAccountSid()
{
throw new NotImplementedException();
}
/// <summary>Returns a value that indicates whether the security identifier (SID) represented by this <see cref="T:System.Security.Principal.SecurityIdentifier" /> object is from the same domain as the specified SID.</summary>
/// <returns>true if the SID represented by this <see cref="T:System.Security.Principal.SecurityIdentifier" /> object is in the same domain as the <paramref name="sid" /> SID; otherwise, false.</returns>
/// <param name="sid">The SID to compare with this <see cref="T:System.Security.Principal.SecurityIdentifier" /> object.</param>
// Token: 0x06003557 RID: 13655 RVA: 0x000B7508 File Offset: 0x000B5708
public bool IsEqualDomainSid(SecurityIdentifier sid)
{
throw new NotImplementedException();
}
/// <summary>Returns a value that indicates whether the specified type is a valid translation type for the <see cref="T:System.Security.Principal.SecurityIdentifier" /> class.</summary>
/// <returns>true if <paramref name="targetType" /> is a valid translation type for the <see cref="T:System.Security.Principal.SecurityIdentifier" /> class; otherwise, false.</returns>
/// <param name="targetType">The type being queried for validity to serve as a conversion from <see cref="T:System.Security.Principal.SecurityIdentifier" />. The following target types are valid:- <see cref="T:System.Security.Principal.NTAccount" />- <see cref="T:System.Security.Principal.SecurityIdentifier" /></param>
// Token: 0x06003558 RID: 13656 RVA: 0x000B7510 File Offset: 0x000B5710
public override bool IsValidTargetType(Type targetType)
{
return targetType == typeof(SecurityIdentifier) || targetType == typeof(NTAccount);
}
/// <summary>Returns a value that indicates whether the <see cref="T:System.Security.Principal.SecurityIdentifier" /> object matches the specified well known security identifier (SID) type. </summary>
/// <returns>true if <paramref name="type" /> is the SID type for the <see cref="T:System.Security.Principal.SecurityIdentifier" /> object; otherwise, false.</returns>
/// <param name="type">A <see cref="T:System.Security.Principal.WellKnownSidType" /> value to compare with the <see cref="T:System.Security.Principal.SecurityIdentifier" /> object.</param>
// Token: 0x06003559 RID: 13657 RVA: 0x000B7538 File Offset: 0x000B5738
public bool IsWellKnown(WellKnownSidType type)
{
throw new NotImplementedException();
}
/// <summary>Returns the security identifier (SID), in Security Descriptor Definition Language (SDDL) format, for the account represented by the <see cref="T:System.Security.Principal.SecurityIdentifier" /> object. An example of the SDDL format is S-1-5-9. </summary>
/// <returns>The SID, in SDDL format, for the account represented by the <see cref="T:System.Security.Principal.SecurityIdentifier" /> object.</returns>
// Token: 0x0600355A RID: 13658 RVA: 0x000B7540 File Offset: 0x000B5740
public override string ToString()
{
return this.Value;
}
/// <summary>Translates the account name represented by the <see cref="T:System.Security.Principal.SecurityIdentifier" /> object into another <see cref="T:System.Security.Principal.IdentityReference" />-derived type.</summary>
/// <returns>The converted identity.</returns>
/// <param name="targetType">The target type for the conversion from <see cref="T:System.Security.Principal.SecurityIdentifier" />. The target type must be a type that is considered valid by the <see cref="M:System.Security.Principal.SecurityIdentifier.IsValidTargetType(System.Type)" /> method.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="targetType " />is null.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="targetType " />is not an <see cref="T:System.Security.Principal.IdentityReference" /> type.</exception>
/// <exception cref="T:System.Security.Principal.IdentityNotMappedException">Some or all identity references could not be translated.</exception>
/// <exception cref="T:System.SystemException">A Win32 error code was returned.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="MemberAccess" />
/// </PermissionSet>
// Token: 0x0600355B RID: 13659 RVA: 0x000B7548 File Offset: 0x000B5748
public override IdentityReference Translate(Type targetType)
{
if (targetType == typeof(SecurityIdentifier))
{
return this;
}
return null;
}
/// <summary>Compares two <see cref="T:System.Security.Principal.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 <see cref="P:System.Security.Principal.SecurityIdentifier.Value" /> property or if they are both null. </summary>
/// <returns>true if <paramref name="left" /> and <paramref name="right" /> are equal; otherwise, false.</returns>
/// <param name="left">The left operand to use for the equality comparison. This parameter can be null.</param>
/// <param name="right">The right operand to use for the equality comparison. This parameter can be null.</param>
// 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;
}
/// <summary>Compares two <see cref="T:System.Security.Principal.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 <see cref="P:System.Security.Principal.SecurityIdentifier.Value" /> property or if one of the objects is null and the other is not.</summary>
/// <returns>true if <paramref name="left" /> and <paramref name="right" /> are not equal; otherwise, false.</returns>
/// <param name="left">The left operand to use for the inequality comparison. This parameter can be null.</param>
/// <param name="right">The right operand to use for the inequality comparison. This parameter can be null.</param>
// 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;
/// <summary>Returns the maximum size, in bytes, of the binary representation of the security identifier.</summary>
/// <returns>The maximum size, in bytes, of the binary representation of the security identifier.</returns>
// Token: 0x0400159A RID: 5530
public static readonly int MaxBinaryLength;
/// <summary>Returns the minimum size, in bytes, of the binary representation of the security identifier.</summary>
/// <returns>The minimum size, in bytes, of the binary representation of the security identifier.</returns>
// Token: 0x0400159B RID: 5531
public static readonly int MinBinaryLength;
}
}
@@ -0,0 +1,53 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Principal
{
/// <summary>Defines the privileges of the user account associated with the access token. </summary>
// Token: 0x020005B3 RID: 1459
[ComVisible(true)]
[Flags]
[Serializable]
public enum TokenAccessLevels
{
/// <summary>The user can attach a primary token to a process.</summary>
// Token: 0x0400159D RID: 5533
AssignPrimary = 1,
/// <summary>The user can duplicate the token.</summary>
// Token: 0x0400159E RID: 5534
Duplicate = 2,
/// <summary>The user can impersonate a client.</summary>
// Token: 0x0400159F RID: 5535
Impersonate = 4,
/// <summary>The user can query the token.</summary>
// Token: 0x040015A0 RID: 5536
Query = 8,
/// <summary>The user can query the source of the token.</summary>
// Token: 0x040015A1 RID: 5537
QuerySource = 16,
/// <summary>The user can enable or disable privileges in the token.</summary>
// Token: 0x040015A2 RID: 5538
AdjustPrivileges = 32,
/// <summary>The user can change the attributes of the groups in the token.</summary>
// Token: 0x040015A3 RID: 5539
AdjustGroups = 64,
/// <summary>The user can change the default owner, primary group, or discretionary access control list (DACL) of the token.</summary>
// Token: 0x040015A4 RID: 5540
AdjustDefault = 128,
/// <summary>The user can adjust the session identifier of the token.</summary>
// Token: 0x040015A5 RID: 5541
AdjustSessionId = 256,
/// <summary>The user has standard read rights and the <see cref="F:System.Security.Principal.TokenAccessLevels.Query" /> privilege for the token.</summary>
// Token: 0x040015A6 RID: 5542
Read = 131080,
/// <summary>The user has standard write rights and the <see cref="F:System.Security.Principal.TokenAccessLevels.AdjustPrivileges, F:System.Security.Principal.TokenAccessLevels.AdjustGroups" />, and <see cref="F:System.Security.Principal.TokenAccessLevels.AdjustDefault" /> privileges for the token.</summary>
// Token: 0x040015A7 RID: 5543
Write = 131296,
/// <summary>The user has all possible access to the token.</summary>
// Token: 0x040015A8 RID: 5544
AllAccess = 983551,
/// <summary>The maximum value that can be assigned for the <see cref="T:System.Security.Principal.TokenAccessLevels" /> enumeration.</summary>
// Token: 0x040015A9 RID: 5545
MaximumAllowed = 33554432
}
}
@@ -0,0 +1,28 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Principal
{
/// <summary>Defines security impersonation levels. Security impersonation levels govern the degree to which a server process can act on behalf of a client process.</summary>
// Token: 0x020005B4 RID: 1460
[ComVisible(true)]
[Serializable]
public enum TokenImpersonationLevel
{
/// <summary>The server process cannot obtain identification information about the client, and it cannot impersonate the client.</summary>
// Token: 0x040015AB RID: 5547
Anonymous = 1,
/// <summary>The server process can impersonate the client's security context on remote systems.</summary>
// Token: 0x040015AC RID: 5548
Delegation = 4,
/// <summary>The server process can obtain information about the client, such as security identifiers and privileges, but it cannot impersonate the client. This is useful for servers that export their own objects, for example, database products that export tables and views. Using the retrieved client-security information, the server can make access-validation decisions without being able to use other services that are using the client's security context.</summary>
// Token: 0x040015AD RID: 5549
Identification = 2,
/// <summary>The server process can impersonate the client's security context on its local system. The server cannot impersonate the client on remote systems.</summary>
// Token: 0x040015AE RID: 5550
Impersonation,
/// <summary>An impersonation level is not assigned.</summary>
// Token: 0x040015AF RID: 5551
None = 0
}
}
@@ -0,0 +1,198 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Principal
{
/// <summary>Defines a set of commonly used security identifiers (SIDs).</summary>
// Token: 0x020005B5 RID: 1461
[ComVisible(false)]
public enum WellKnownSidType
{
/// <summary>Indicates a null SID.</summary>
// Token: 0x040015B1 RID: 5553
NullSid,
/// <summary>Indicates a SID that matches everyone.</summary>
// Token: 0x040015B2 RID: 5554
WorldSid,
/// <summary>Indicates a local SID.</summary>
// Token: 0x040015B3 RID: 5555
LocalSid,
/// <summary>Indicates a SID that matches the owner or creator of an object.</summary>
// Token: 0x040015B4 RID: 5556
CreatorOwnerSid,
/// <summary>Indicates a SID that matches the creator group of an object.</summary>
// Token: 0x040015B5 RID: 5557
CreatorGroupSid,
/// <summary>Indicates a creator owner server SID.</summary>
// Token: 0x040015B6 RID: 5558
CreatorOwnerServerSid,
/// <summary>Indicates a creator group server SID.</summary>
// Token: 0x040015B7 RID: 5559
CreatorGroupServerSid,
/// <summary>Indicates a SID for the Windows NT authority.</summary>
// Token: 0x040015B8 RID: 5560
NTAuthoritySid,
/// <summary>Indicates a SID for a dial-up account.</summary>
// Token: 0x040015B9 RID: 5561
DialupSid,
/// <summary>Indicates a SID for a network account. This SID is added to the process of a token when it logs on across a network.</summary>
// Token: 0x040015BA RID: 5562
NetworkSid,
/// <summary>Indicates a SID for a batch process. This SID is added to the process of a token when it logs on as a batch job.</summary>
// Token: 0x040015BB RID: 5563
BatchSid,
/// <summary>Indicates a SID for an interactive account. This SID is added to the process of a token when it logs on interactively.</summary>
// Token: 0x040015BC RID: 5564
InteractiveSid,
/// <summary>Indicates a SID for a service. This SID is added to the process of a token when it logs on as a service.</summary>
// Token: 0x040015BD RID: 5565
ServiceSid,
/// <summary>Indicates a SID for the anonymous account.</summary>
// Token: 0x040015BE RID: 5566
AnonymousSid,
/// <summary>Indicates a proxy SID.</summary>
// Token: 0x040015BF RID: 5567
ProxySid,
/// <summary>Indicates a SID for an enterprise controller.</summary>
// Token: 0x040015C0 RID: 5568
EnterpriseControllersSid,
/// <summary>Indicates a SID for self.</summary>
// Token: 0x040015C1 RID: 5569
SelfSid,
/// <summary>Indicates a SID for an authenticated user.</summary>
// Token: 0x040015C2 RID: 5570
AuthenticatedUserSid,
/// <summary>Indicates a SID for restricted code.</summary>
// Token: 0x040015C3 RID: 5571
RestrictedCodeSid,
/// <summary>Indicates a SID that matches a terminal server account.</summary>
// Token: 0x040015C4 RID: 5572
TerminalServerSid,
/// <summary>Indicates a SID that matches remote logons.</summary>
// Token: 0x040015C5 RID: 5573
RemoteLogonIdSid,
/// <summary>Indicates a SID that matches logon IDs.</summary>
// Token: 0x040015C6 RID: 5574
LogonIdsSid,
/// <summary>Indicates a SID that matches the local system.</summary>
// Token: 0x040015C7 RID: 5575
LocalSystemSid,
/// <summary>Indicates a SID that matches a local service.</summary>
// Token: 0x040015C8 RID: 5576
LocalServiceSid,
/// <summary>Indicates a SID that matches a network service.</summary>
// Token: 0x040015C9 RID: 5577
NetworkServiceSid,
/// <summary>Indicates a SID that matches the domain account.</summary>
// Token: 0x040015CA RID: 5578
BuiltinDomainSid,
/// <summary>Indicates a SID that matches the administrator account.</summary>
// Token: 0x040015CB RID: 5579
BuiltinAdministratorsSid,
/// <summary>Indicates a SID that matches built-in user accounts.</summary>
// Token: 0x040015CC RID: 5580
BuiltinUsersSid,
/// <summary>Indicates a SID that matches the guest account.</summary>
// Token: 0x040015CD RID: 5581
BuiltinGuestsSid,
/// <summary>Indicates a SID that matches the power users group.</summary>
// Token: 0x040015CE RID: 5582
BuiltinPowerUsersSid,
/// <summary>Indicates a SID that matches the account operators account.</summary>
// Token: 0x040015CF RID: 5583
BuiltinAccountOperatorsSid,
/// <summary>Indicates a SID that matches the system operators group.</summary>
// Token: 0x040015D0 RID: 5584
BuiltinSystemOperatorsSid,
/// <summary>Indicates a SID that matches the print operators group.</summary>
// Token: 0x040015D1 RID: 5585
BuiltinPrintOperatorsSid,
/// <summary>Indicates a SID that matches the backup operators group.</summary>
// Token: 0x040015D2 RID: 5586
BuiltinBackupOperatorsSid,
/// <summary>Indicates a SID that matches the replicator account.</summary>
// Token: 0x040015D3 RID: 5587
BuiltinReplicatorSid,
/// <summary>Indicates a SID that matches pre-Windows 2000 compatible accounts.</summary>
// Token: 0x040015D4 RID: 5588
BuiltinPreWindows2000CompatibleAccessSid,
/// <summary>Indicates a SID that matches remote desktop users.</summary>
// Token: 0x040015D5 RID: 5589
BuiltinRemoteDesktopUsersSid,
/// <summary>Indicates a SID that matches the network operators group.</summary>
// Token: 0x040015D6 RID: 5590
BuiltinNetworkConfigurationOperatorsSid,
/// <summary>Indicates a SID that matches the account administrators group.</summary>
// Token: 0x040015D7 RID: 5591
AccountAdministratorSid,
/// <summary>Indicates a SID that matches the account guest group.</summary>
// Token: 0x040015D8 RID: 5592
AccountGuestSid,
/// <summary>Indicates a SID that matches the account Kerberos target group.</summary>
// Token: 0x040015D9 RID: 5593
AccountKrbtgtSid,
/// <summary>Indicates a SID that matches the account domain administrator group.</summary>
// Token: 0x040015DA RID: 5594
AccountDomainAdminsSid,
/// <summary>Indicates a SID that matches the account domain users group.</summary>
// Token: 0x040015DB RID: 5595
AccountDomainUsersSid,
/// <summary>Indicates a SID that matches the account domain guests group.</summary>
// Token: 0x040015DC RID: 5596
AccountDomainGuestsSid,
/// <summary>Indicates a SID that matches the account computer group.</summary>
// Token: 0x040015DD RID: 5597
AccountComputersSid,
/// <summary>Indicates a SID that matches the account controller group.</summary>
// Token: 0x040015DE RID: 5598
AccountControllersSid,
/// <summary>Indicates a SID that matches the certificate administrators group.</summary>
// Token: 0x040015DF RID: 5599
AccountCertAdminsSid,
/// <summary>Indicates a SID that matches the schema administrators group.</summary>
// Token: 0x040015E0 RID: 5600
AccountSchemaAdminsSid,
/// <summary>Indicates a SID that matches the enterprise administrators group.</summary>
// Token: 0x040015E1 RID: 5601
AccountEnterpriseAdminsSid,
/// <summary>Indicates a SID that matches the policy administrators group.</summary>
// Token: 0x040015E2 RID: 5602
AccountPolicyAdminsSid,
/// <summary>Indicates a SID that matches the RAS and IAS server account.</summary>
// Token: 0x040015E3 RID: 5603
AccountRasAndIasServersSid,
/// <summary>Indicates a SID present when the Microsoft NTLM authentication package authenticated the client.</summary>
// Token: 0x040015E4 RID: 5604
NtlmAuthenticationSid,
/// <summary>Indicates a SID present when the Microsoft Digest authentication package authenticated the client.</summary>
// Token: 0x040015E5 RID: 5605
DigestAuthenticationSid,
/// <summary>Indicates a SID present when the Secure Channel (SSL/TLS) authentication package authenticated the client.</summary>
// Token: 0x040015E6 RID: 5606
SChannelAuthenticationSid,
/// <summary>Indicates a SID present when the user authenticated from within the forest or across a trust that does not have the selective authentication option enabled. If this SID is present, then <see cref="F:System.Security.Principal.WellKnownSidType.OtherOrganizationSid" /> cannot be present.</summary>
// Token: 0x040015E7 RID: 5607
ThisOrganizationSid,
/// <summary>Indicates a SID present when the user authenticated across a forest with the selective authentication option enabled. If this SID is present, then <see cref="F:System.Security.Principal.WellKnownSidType.ThisOrganizationSid" /> cannot be present.</summary>
// Token: 0x040015E8 RID: 5608
OtherOrganizationSid,
/// <summary>Indicates a SID that allows a user to create incoming forest trusts. It is added to the token of users who are a member of the Incoming Forest Trust Builders built-in group in the root domain of the forest.</summary>
// Token: 0x040015E9 RID: 5609
BuiltinIncomingForestTrustBuildersSid,
/// <summary>Indicates a SID that matches the group of users that have remote access to schedule logging of performance counters on this computer.</summary>
// Token: 0x040015EA RID: 5610
BuiltinPerformanceMonitoringUsersSid,
/// <summary>Indicates a SID that matches the group of users that have remote access to monitor the computer.</summary>
// Token: 0x040015EB RID: 5611
BuiltinPerformanceLoggingUsersSid,
/// <summary>Indicates a SID that matches the Windows Authorization Access group.</summary>
// Token: 0x040015EC RID: 5612
BuiltinAuthorizationAccessSid,
/// <summary>Indicates a SID is present in a server that can issue Terminal Server licenses.</summary>
// Token: 0x040015ED RID: 5613
WinBuiltinTerminalServerLicenseServersSid,
/// <summary>Indicates the maximum defined SID in the <see cref="T:System.Security.Principal.WellKnownSidType" /> enumeration.</summary>
// Token: 0x040015EE RID: 5614
MaxDefined = 60
}
}
@@ -0,0 +1,25 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Principal
{
/// <summary>Specifies the type of Windows account used.</summary>
// Token: 0x020005B6 RID: 1462
[ComVisible(true)]
[Serializable]
public enum WindowsAccountType
{
/// <summary>A normal user account.</summary>
// Token: 0x040015F0 RID: 5616
Normal,
/// <summary>A Windows guest account.</summary>
// Token: 0x040015F1 RID: 5617
Guest,
/// <summary>A Windows system account.</summary>
// Token: 0x040015F2 RID: 5618
System,
/// <summary>An anonymous account.</summary>
// Token: 0x040015F3 RID: 5619
Anonymous
}
}
@@ -0,0 +1,40 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Principal
{
/// <summary>Specifies common roles to be used with <see cref="M:System.Security.Principal.WindowsPrincipal.IsInRole(System.String)" />.</summary>
// Token: 0x020005B7 RID: 1463
[ComVisible(true)]
[Serializable]
public enum WindowsBuiltInRole
{
/// <summary>Administrators have complete and unrestricted access to the computer or domain.</summary>
// Token: 0x040015F5 RID: 5621
Administrator = 544,
/// <summary>Users are prevented from making accidental or intentional system-wide changes. Thus, users can run certified applications, but not most legacy applications.</summary>
// Token: 0x040015F6 RID: 5622
User,
/// <summary>Guests are more restricted than users.</summary>
// Token: 0x040015F7 RID: 5623
Guest,
/// <summary>Power users possess most administrative permissions with some restrictions. Thus, power users can run legacy applications, in addition to certified applications.</summary>
// Token: 0x040015F8 RID: 5624
PowerUser,
/// <summary>Account operators manage the user accounts on a computer or domain.</summary>
// Token: 0x040015F9 RID: 5625
AccountOperator,
/// <summary>System operators manage a particular computer.</summary>
// Token: 0x040015FA RID: 5626
SystemOperator,
/// <summary>Print operators can take control of a printer.</summary>
// Token: 0x040015FB RID: 5627
PrintOperator,
/// <summary>Backup operators can override security restrictions for the sole purpose of backing up or restoring files.</summary>
// Token: 0x040015FC RID: 5628
BackupOperator,
/// <summary>Replicators support file replication in a domain.</summary>
// Token: 0x040015FD RID: 5629
Replicator
}
}
@@ -0,0 +1,479 @@
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
namespace System.Security.Principal
{
/// <summary>Represents a Windows user.</summary>
// Token: 0x020005B8 RID: 1464
[ComVisible(true)]
[Serializable]
public class WindowsIdentity : IDisposable, ISerializable, IDeserializationCallback, IIdentity
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Principal.WindowsIdentity" /> class for the user represented by the specified Windows account token.</summary>
/// <param name="userToken">The account token for the user on whose behalf the code is running. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="userToken" /> is 0.-or-<paramref name="userToken" /> is duplicated and invalid for impersonation.</exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the correct permissions. -or-A Win32 error occurred.</exception>
// Token: 0x0600355E RID: 13662 RVA: 0x000B75C8 File Offset: 0x000B57C8
public WindowsIdentity(IntPtr userToken)
: this(userToken, null, WindowsAccountType.Normal, false)
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Principal.WindowsIdentity" /> class for the user represented by the specified Windows account token and the specified authentication type.</summary>
/// <param name="userToken">The account token for the user on whose behalf the code is running. </param>
/// <param name="type">(Informational) The type of authentication used to identify the user. For more information, see Remarks.</param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="userToken" /> is 0.-or-<paramref name="userToken" /> is duplicated and invalid for impersonation.</exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the correct permissions. -or-A Win32 error occurred.</exception>
// Token: 0x0600355F RID: 13663 RVA: 0x000B75D4 File Offset: 0x000B57D4
public WindowsIdentity(IntPtr userToken, string type)
: this(userToken, type, WindowsAccountType.Normal, false)
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Principal.WindowsIdentity" /> class for the user represented by the specified Windows account token, the specified authentication type, and the specified Windows account type.</summary>
/// <param name="userToken">The account token for the user on whose behalf the code is running. </param>
/// <param name="type">(Informational) The type of authentication used to identify the user. For more information, see Remarks.</param>
/// <param name="acctType">One of the <see cref="T:System.Security.Principal.WindowsAccountType" /> values. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="userToken" /> is 0.-or-<paramref name="userToken" /> is duplicated and invalid for impersonation.</exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the correct permissions. -or-A Win32 error occurred.</exception>
// Token: 0x06003560 RID: 13664 RVA: 0x000B75E0 File Offset: 0x000B57E0
public WindowsIdentity(IntPtr userToken, string type, WindowsAccountType acctType)
: this(userToken, type, acctType, false)
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Principal.WindowsIdentity" /> class for the user represented by the specified Windows account token, the specified authentication type, the specified Windows account type, and the specified authentication status.</summary>
/// <param name="userToken">The account token for the user on whose behalf the code is running. </param>
/// <param name="type">(Informational) The type of authentication used to identify the user. For more information, see Remarks.</param>
/// <param name="acctType">One of the <see cref="T:System.Security.Principal.WindowsAccountType" /> values. </param>
/// <param name="isAuthenticated">true to indicate that the user is authenticated; otherwise, false. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="userToken" /> is 0.-or-<paramref name="userToken" /> is duplicated and invalid for impersonation.</exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the correct permissions. -or-A Win32 error occurred.</exception>
// Token: 0x06003561 RID: 13665 RVA: 0x000B75EC File Offset: 0x000B57EC
public WindowsIdentity(IntPtr userToken, string type, WindowsAccountType acctType, bool isAuthenticated)
{
this._type = type;
this._account = acctType;
this._authenticated = isAuthenticated;
this._name = null;
this.SetToken(userToken);
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Principal.WindowsIdentity" /> class for the user represented by the specified User Principal Name (UPN).</summary>
/// <param name="sUserPrincipalName">The UPN for the user on whose behalf the code is running. </param>
/// <exception cref="T:System.UnauthorizedAccessException">Windows returned the Windows NT status code STATUS_ACCESS_DENIED.</exception>
/// <exception cref="T:System.OutOfMemoryException">There is insufficient memory available.</exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the correct permissions. </exception>
// Token: 0x06003562 RID: 13666 RVA: 0x000B7624 File Offset: 0x000B5824
public WindowsIdentity(string sUserPrincipalName)
: this(sUserPrincipalName, null)
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Principal.WindowsIdentity" /> class for the user represented by the specified User Principal Name (UPN) and the specified authentication type.</summary>
/// <param name="sUserPrincipalName">The UPN for the user on whose behalf the code is running. </param>
/// <param name="type">(Informational) The type of authentication used to identify the user. </param>
/// <exception cref="T:System.UnauthorizedAccessException">Windows returned the Windows NT status code STATUS_ACCESS_DENIED.</exception>
/// <exception cref="T:System.OutOfMemoryException">There is insufficient memory available.</exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the correct permissions. </exception>
// Token: 0x06003563 RID: 13667 RVA: 0x000B7630 File Offset: 0x000B5830
public WindowsIdentity(string sUserPrincipalName, string type)
{
if (sUserPrincipalName == null)
{
throw new NullReferenceException("sUserPrincipalName");
}
IntPtr userToken = WindowsIdentity.GetUserToken(sUserPrincipalName);
if (!WindowsIdentity.IsPosix && userToken == IntPtr.Zero)
{
throw new ArgumentException("only for Windows Server 2003 +");
}
this._authenticated = true;
this._account = WindowsAccountType.Normal;
this._type = type;
this.SetToken(userToken);
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Principal.WindowsIdentity" /> class for the user represented by information in a <see cref="T:System.Runtime.Serialization.SerializationInfo" /> stream.</summary>
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> containing the account information for the user. </param>
/// <param name="context">A <see cref="T:System.Runtime.Serialization.StreamingContext" /> that indicates the stream characteristics. </param>
/// <exception cref="T:System.NotSupportedException">A <see cref="T:System.Security.Principal.WindowsIdentity" /> cannot be serialized across processes. </exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the correct permissions. -or-A Win32 error occurred.</exception>
// Token: 0x06003564 RID: 13668 RVA: 0x000B769C File Offset: 0x000B589C
public WindowsIdentity(SerializationInfo info, StreamingContext context)
{
this._info = info;
}
/// <summary>Implements the <see cref="T:System.Runtime.Serialization.ISerializable" /> interface and is called back by the deserialization event when deserialization is complete.</summary>
/// <param name="sender">The source of the deserialization event. </param>
// Token: 0x06003566 RID: 13670 RVA: 0x000B76B8 File Offset: 0x000B58B8
void IDeserializationCallback.OnDeserialization(object sender)
{
this._token = (IntPtr)this._info.GetValue("m_userToken", typeof(IntPtr));
this._name = this._info.GetString("m_name");
if (this._name != null)
{
string tokenName = WindowsIdentity.GetTokenName(this._token);
if (tokenName != this._name)
{
throw new SerializationException("Token-Name mismatch.");
}
}
else
{
this._name = WindowsIdentity.GetTokenName(this._token);
if (this._name == string.Empty || this._name == null)
{
throw new SerializationException("Token doesn't match a user.");
}
}
this._type = this._info.GetString("m_type");
this._account = (WindowsAccountType)((int)this._info.GetValue("m_acctType", typeof(WindowsAccountType)));
this._authenticated = this._info.GetBoolean("m_isAuthenticated");
}
/// <summary>Sets the <see cref="T:System.Runtime.Serialization.SerializationInfo" /> object with the logical context information needed to recreate an instance of this execution context.</summary>
/// <param name="info">A <see cref="T:System.Runtime.Serialization.SerializationInfo" /> object containing the information required to serialize the <see cref="T:System.Collections.Hashtable" />. </param>
/// <param name="context">A <see cref="T:System.Runtime.Serialization.StreamingContext" /> object containing the source and destination of the serialized stream associated with the <see cref="T:System.Collections.Hashtable" />. </param>
// Token: 0x06003567 RID: 13671 RVA: 0x000B77C8 File Offset: 0x000B59C8
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
{
info.AddValue("m_userToken", this._token);
info.AddValue("m_name", this._name);
info.AddValue("m_type", this._type);
info.AddValue("m_acctType", this._account);
info.AddValue("m_isAuthenticated", this._authenticated);
}
/// <summary>Releases all resources used by the <see cref="T:System.Security.Principal.WindowsIdentity" />. </summary>
// Token: 0x06003568 RID: 13672 RVA: 0x000B7834 File Offset: 0x000B5A34
[ComVisible(false)]
public void Dispose()
{
this._token = IntPtr.Zero;
}
/// <summary>Releases the unmanaged resources used by the <see cref="T:System.Security.Principal.WindowsIdentity" /> and optionally releases the managed resources. </summary>
/// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources. </param>
// Token: 0x06003569 RID: 13673 RVA: 0x000B7844 File Offset: 0x000B5A44
[ComVisible(false)]
protected virtual void Dispose(bool disposing)
{
this._token = IntPtr.Zero;
}
/// <summary>Returns a <see cref="T:System.Security.Principal.WindowsIdentity" /> object that represents an anonymous user.</summary>
/// <returns>A <see cref="T:System.Security.Principal.WindowsIdentity" /> object that represents an anonymous user.</returns>
// Token: 0x0600356A RID: 13674 RVA: 0x000B7854 File Offset: 0x000B5A54
public static WindowsIdentity GetAnonymous()
{
WindowsIdentity windowsIdentity;
if (WindowsIdentity.IsPosix)
{
windowsIdentity = new WindowsIdentity("nobody");
windowsIdentity._account = WindowsAccountType.Anonymous;
windowsIdentity._authenticated = false;
windowsIdentity._type = string.Empty;
}
else
{
windowsIdentity = new WindowsIdentity(IntPtr.Zero, string.Empty, WindowsAccountType.Anonymous, false);
windowsIdentity._name = string.Empty;
}
return windowsIdentity;
}
/// <summary>Returns a <see cref="T:System.Security.Principal.WindowsIdentity" /> object that represents the current Windows user.</summary>
/// <returns>A <see cref="T:System.Security.Principal.WindowsIdentity" /> object that represents the current user.</returns>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the correct permissions. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlPrincipal" />
/// </PermissionSet>
// Token: 0x0600356B RID: 13675 RVA: 0x000B78B4 File Offset: 0x000B5AB4
public static WindowsIdentity GetCurrent()
{
return new WindowsIdentity(WindowsIdentity.GetCurrentToken(), null, WindowsAccountType.Normal, true);
}
/// <summary>Returns a <see cref="T:System.Security.Principal.WindowsIdentity" /> object that represents the Windows identity for either the thread or the process, depending on the value of the <paramref name="ifImpersonating" /> parameter.</summary>
/// <returns>A <see cref="T:System.Security.Principal.WindowsIdentity" /> object that represents a Windows user.</returns>
/// <param name="ifImpersonating">true to return the <see cref="T:System.Security.Principal.WindowsIdentity" /> only if the thread is currently impersonating; false to return the <see cref="T:System.Security.Principal.WindowsIdentity" /> of the thread if it is impersonating or the <see cref="T:System.Security.Principal.WindowsIdentity" /> of the process if the thread is not currently impersonating.</param>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlPrincipal" />
/// </PermissionSet>
// Token: 0x0600356C RID: 13676 RVA: 0x000B78C4 File Offset: 0x000B5AC4
[MonoTODO("need icall changes")]
public static WindowsIdentity GetCurrent(bool ifImpersonating)
{
throw new NotImplementedException();
}
/// <summary>Returns a <see cref="T:System.Security.Principal.WindowsIdentity" /> object that represents the current Windows user, using the specified desired token access level.</summary>
/// <returns>A <see cref="T:System.Security.Principal.WindowsIdentity" /> object that represents the current user.</returns>
/// <param name="desiredAccess">A bitwise combination of the <see cref="T:System.Security.Principal.TokenAccessLevels" /> values. </param>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlPrincipal" />
/// </PermissionSet>
// Token: 0x0600356D RID: 13677 RVA: 0x000B78CC File Offset: 0x000B5ACC
[MonoTODO("need icall changes")]
public static WindowsIdentity GetCurrent(TokenAccessLevels desiredAccess)
{
throw new NotImplementedException();
}
/// <summary>Impersonates the user represented by the <see cref="T:System.Security.Principal.WindowsIdentity" /> object.</summary>
/// <returns>A <see cref="T:System.Security.Principal.WindowsImpersonationContext" /> object that represents the Windows user prior to impersonation; this can be used to revert to the original user's context.</returns>
/// <exception cref="T:System.InvalidOperationException">An anonymous identity attempted to perform an impersonation.</exception>
/// <exception cref="T:System.Security.SecurityException">A Win32 error occurred.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlPrincipal" />
/// </PermissionSet>
// Token: 0x0600356E RID: 13678 RVA: 0x000B78D4 File Offset: 0x000B5AD4
public virtual WindowsImpersonationContext Impersonate()
{
return new WindowsImpersonationContext(this._token);
}
/// <summary>Impersonates the user represented by the specified user token.</summary>
/// <returns>A <see cref="T:System.Security.Principal.WindowsImpersonationContext" /> object that represents the Windows user prior to impersonation; this object can be used to revert to the original user's context.</returns>
/// <param name="userToken">The handle of a Windows account token. This token is usually retrieved through a call to unmanaged code, such as a call to the Win32 API LogonUser function. </param>
/// <exception cref="T:System.UnauthorizedAccessException">Windows returned the Windows NT status code STATUS_ACCESS_DENIED.</exception>
/// <exception cref="T:System.OutOfMemoryException">There is insufficient memory available.</exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the correct permissions. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlPrincipal" />
/// </PermissionSet>
// Token: 0x0600356F RID: 13679 RVA: 0x000B78E4 File Offset: 0x000B5AE4
public static WindowsImpersonationContext Impersonate(IntPtr userToken)
{
return new WindowsImpersonationContext(userToken);
}
/// <summary>Gets the type of authentication used to identify the user.</summary>
/// <returns>The type of authentication used to identify the user.</returns>
// Token: 0x17000A77 RID: 2679
// (get) Token: 0x06003570 RID: 13680 RVA: 0x000B78EC File Offset: 0x000B5AEC
public string AuthenticationType
{
get
{
return this._type;
}
}
/// <summary>Gets a value indicating whether the user account is identified as an anonymous account by the system.</summary>
/// <returns>true if the user account is an anonymous account; otherwise, false.</returns>
// Token: 0x17000A78 RID: 2680
// (get) Token: 0x06003571 RID: 13681 RVA: 0x000B78F4 File Offset: 0x000B5AF4
public virtual bool IsAnonymous
{
get
{
return this._account == WindowsAccountType.Anonymous;
}
}
/// <summary>Gets a value indicating whether the user has been authenticated by Windows.</summary>
/// <returns>true if the user was authenticated; otherwise, false.</returns>
// Token: 0x17000A79 RID: 2681
// (get) Token: 0x06003572 RID: 13682 RVA: 0x000B7900 File Offset: 0x000B5B00
public virtual bool IsAuthenticated
{
get
{
return this._authenticated;
}
}
/// <summary>Gets a value indicating whether the user account is identified as a <see cref="F:System.Security.Principal.WindowsAccountType.Guest" /> account by the system.</summary>
/// <returns>true if the user account is a <see cref="F:System.Security.Principal.WindowsAccountType.Guest" /> account; otherwise, false.</returns>
// Token: 0x17000A7A RID: 2682
// (get) Token: 0x06003573 RID: 13683 RVA: 0x000B7908 File Offset: 0x000B5B08
public virtual bool IsGuest
{
get
{
return this._account == WindowsAccountType.Guest;
}
}
/// <summary>Gets a value indicating whether the user account is identified as a <see cref="F:System.Security.Principal.WindowsAccountType.System" /> account by the system.</summary>
/// <returns>true if the user account is a <see cref="F:System.Security.Principal.WindowsAccountType.System" /> account; otherwise, false.</returns>
// Token: 0x17000A7B RID: 2683
// (get) Token: 0x06003574 RID: 13684 RVA: 0x000B7914 File Offset: 0x000B5B14
public virtual bool IsSystem
{
get
{
return this._account == WindowsAccountType.System;
}
}
/// <summary>Gets the user's Windows logon name.</summary>
/// <returns>The Windows logon name of the user on whose behalf the code is being run.</returns>
// Token: 0x17000A7C RID: 2684
// (get) Token: 0x06003575 RID: 13685 RVA: 0x000B7920 File Offset: 0x000B5B20
public virtual string Name
{
get
{
if (this._name == null)
{
this._name = WindowsIdentity.GetTokenName(this._token);
}
return this._name;
}
}
/// <summary>Gets the Windows account token for the user.</summary>
/// <returns>The handle of the access token associated with the current execution thread.</returns>
// Token: 0x17000A7D RID: 2685
// (get) Token: 0x06003576 RID: 13686 RVA: 0x000B7950 File Offset: 0x000B5B50
public virtual IntPtr Token
{
get
{
return this._token;
}
}
/// <summary>Gets the groups the current Windows user belongs to.</summary>
/// <returns>An <see cref="T:System.Security.Principal.IdentityReferenceCollection" /> object representing the groups the current Windows user belongs to.</returns>
// Token: 0x17000A7E RID: 2686
// (get) Token: 0x06003577 RID: 13687 RVA: 0x000B7958 File Offset: 0x000B5B58
[MonoTODO("not implemented")]
public IdentityReferenceCollection Groups
{
get
{
throw new NotImplementedException();
}
}
/// <summary>Gets the impersonation level for the user.</summary>
/// <returns>One of the <see cref="T:System.Management.ImpersonationLevel" /> values. </returns>
// Token: 0x17000A7F RID: 2687
// (get) Token: 0x06003578 RID: 13688 RVA: 0x000B7960 File Offset: 0x000B5B60
[ComVisible(false)]
[MonoTODO("not implemented")]
public TokenImpersonationLevel ImpersonationLevel
{
get
{
throw new NotImplementedException();
}
}
/// <summary>Gets the security identifier (SID) for the token owner.</summary>
/// <returns>A <see cref="T:System.Security.Principal.SecurityIdentifier" /> object for the token owner.</returns>
// Token: 0x17000A80 RID: 2688
// (get) Token: 0x06003579 RID: 13689 RVA: 0x000B7968 File Offset: 0x000B5B68
[ComVisible(false)]
[MonoTODO("not implemented")]
public SecurityIdentifier Owner
{
get
{
throw new NotImplementedException();
}
}
/// <summary>Gets the security identifier (SID) for the user.</summary>
/// <returns>A <see cref="T:System.Security.Principal.SecurityIdentifier" /> object for the user.</returns>
// Token: 0x17000A81 RID: 2689
// (get) Token: 0x0600357A RID: 13690 RVA: 0x000B7970 File Offset: 0x000B5B70
[ComVisible(false)]
[MonoTODO("not implemented")]
public SecurityIdentifier User
{
get
{
throw new NotImplementedException();
}
}
// Token: 0x17000A82 RID: 2690
// (get) Token: 0x0600357B RID: 13691 RVA: 0x000B7978 File Offset: 0x000B5B78
private static bool IsPosix
{
get
{
int platform = (int)Environment.Platform;
return platform == 128 || platform == 4 || platform == 6;
}
}
// Token: 0x0600357C RID: 13692 RVA: 0x000B79A4 File Offset: 0x000B5BA4
private void SetToken(IntPtr token)
{
if (WindowsIdentity.IsPosix)
{
this._token = token;
if (this._type == null)
{
this._type = "POSIX";
}
if (this._token == IntPtr.Zero)
{
this._account = WindowsAccountType.System;
}
}
else
{
if (token == WindowsIdentity.invalidWindows && this._account != WindowsAccountType.Anonymous)
{
throw new ArgumentException("Invalid token");
}
this._token = token;
if (this._type == null)
{
this._type = "NTLM";
}
}
}
// Token: 0x0600357D RID: 13693
[MethodImpl(MethodImplOptions.InternalCall)]
internal static extern string[] _GetRoles(IntPtr token);
// Token: 0x0600357E RID: 13694
[MethodImpl(MethodImplOptions.InternalCall)]
internal static extern IntPtr GetCurrentToken();
// Token: 0x0600357F RID: 13695
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern string GetTokenName(IntPtr token);
// Token: 0x06003580 RID: 13696
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern IntPtr GetUserToken(string username);
// Token: 0x040015FE RID: 5630
private IntPtr _token;
// Token: 0x040015FF RID: 5631
private string _type;
// Token: 0x04001600 RID: 5632
private WindowsAccountType _account;
// Token: 0x04001601 RID: 5633
private bool _authenticated;
// Token: 0x04001602 RID: 5634
private string _name;
// Token: 0x04001603 RID: 5635
private SerializationInfo _info;
// Token: 0x04001604 RID: 5636
private static IntPtr invalidWindows = IntPtr.Zero;
}
}
@@ -0,0 +1,87 @@
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace System.Security.Principal
{
/// <summary>Represents the Windows user prior to an impersonation operation.</summary>
// Token: 0x020005B9 RID: 1465
[ComVisible(true)]
public class WindowsImpersonationContext : IDisposable
{
// Token: 0x06003581 RID: 13697 RVA: 0x000B7A40 File Offset: 0x000B5C40
internal WindowsImpersonationContext(IntPtr token)
{
this._token = WindowsImpersonationContext.DuplicateToken(token);
if (!WindowsImpersonationContext.SetCurrentToken(token))
{
throw new SecurityException("Couldn't impersonate token.");
}
this.undo = false;
}
/// <summary>Releases all resources used by the <see cref="T:System.Security.Principal.WindowsImpersonationContext" />.</summary>
// Token: 0x06003582 RID: 13698 RVA: 0x000B7A74 File Offset: 0x000B5C74
[ComVisible(false)]
public void Dispose()
{
if (!this.undo)
{
this.Undo();
}
}
/// <summary>Releases the unmanaged resources used by the <see cref="T:System.Security.Principal.WindowsImpersonationContext" /> and optionally releases the managed resources. </summary>
/// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources. </param>
// Token: 0x06003583 RID: 13699 RVA: 0x000B7A88 File Offset: 0x000B5C88
[ComVisible(false)]
protected virtual void Dispose(bool disposing)
{
if (!this.undo)
{
this.Undo();
}
if (disposing)
{
GC.SuppressFinalize(this);
}
}
/// <summary>Reverts the user context to the Windows user represented by this object.</summary>
/// <exception cref="T:System.Security.SecurityException">An attempt is made to use this method for any purpose other than to revert identity to self. </exception>
// Token: 0x06003584 RID: 13700 RVA: 0x000B7AA8 File Offset: 0x000B5CA8
public void Undo()
{
if (!WindowsImpersonationContext.RevertToSelf())
{
WindowsImpersonationContext.CloseToken(this._token);
throw new SecurityException("Couldn't switch back to original token.");
}
WindowsImpersonationContext.CloseToken(this._token);
this.undo = true;
GC.SuppressFinalize(this);
}
// Token: 0x06003585 RID: 13701
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern bool CloseToken(IntPtr token);
// Token: 0x06003586 RID: 13702
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern IntPtr DuplicateToken(IntPtr token);
// Token: 0x06003587 RID: 13703
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern bool SetCurrentToken(IntPtr token);
// Token: 0x06003588 RID: 13704
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern bool RevertToSelf();
// Token: 0x04001605 RID: 5637
private IntPtr _token;
// Token: 0x04001606 RID: 5638
private bool undo;
}
}
@@ -0,0 +1,195 @@
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace System.Security.Principal
{
/// <summary>Allows code to check the Windows group membership of a Windows user.</summary>
// Token: 0x020005BA RID: 1466
[ComVisible(true)]
[Serializable]
public class WindowsPrincipal : IPrincipal
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Principal.WindowsPrincipal" /> class by using the specified <see cref="T:System.Security.Principal.WindowsIdentity" /> object.</summary>
/// <param name="ntIdentity">The <see cref="T:System.Security.Principal.WindowsIdentity" /> object from which to construct the new instance of <see cref="T:System.Security.Principal.WindowsPrincipal" />. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="ntIdentity" /> is null. </exception>
// Token: 0x06003589 RID: 13705 RVA: 0x000B7AF0 File Offset: 0x000B5CF0
public WindowsPrincipal(WindowsIdentity ntIdentity)
{
if (ntIdentity == null)
{
throw new ArgumentNullException("ntIdentity");
}
this._identity = ntIdentity;
}
/// <summary>Gets the identity of the current principal.</summary>
/// <returns>The <see cref="T:System.Security.Principal.WindowsIdentity" /> object of the current principal.</returns>
// Token: 0x17000A83 RID: 2691
// (get) Token: 0x0600358A RID: 13706 RVA: 0x000B7B10 File Offset: 0x000B5D10
public virtual IIdentity Identity
{
get
{
return this._identity;
}
}
/// <summary>Determines whether the current principal belongs to the Windows user group with the specified relative identifier (RID).</summary>
/// <returns>true if the current principal is a member of the specified Windows user group, that is, in a particular role; otherwise, false.</returns>
/// <param name="rid">The RID of the Windows user group in which to check for the principals membership status. </param>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="MemberAccess" />
/// </PermissionSet>
// Token: 0x0600358B RID: 13707 RVA: 0x000B7B18 File Offset: 0x000B5D18
public virtual bool IsInRole(int rid)
{
if (WindowsPrincipal.IsPosix)
{
return WindowsPrincipal.IsMemberOfGroupId(this.Token, (IntPtr)rid);
}
string text;
switch (rid)
{
case 544:
text = "BUILTIN\\Administrators";
break;
case 545:
text = "BUILTIN\\Users";
break;
case 546:
text = "BUILTIN\\Guests";
break;
case 547:
text = "BUILTIN\\Power Users";
break;
case 548:
text = "BUILTIN\\Account Operators";
break;
case 549:
text = "BUILTIN\\System Operators";
break;
case 550:
text = "BUILTIN\\Print Operators";
break;
case 551:
text = "BUILTIN\\Backup Operators";
break;
case 552:
text = "BUILTIN\\Replicator";
break;
default:
return false;
}
return this.IsInRole(text);
}
/// <summary>Determines whether the current principal belongs to the Windows user group with the specified name.</summary>
/// <returns>true if the current principal is a member of the specified Windows user group; otherwise, false.</returns>
/// <param name="role">The name of the Windows user group for which to check membership. </param>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="MemberAccess" />
/// </PermissionSet>
// Token: 0x0600358C RID: 13708 RVA: 0x000B7BE8 File Offset: 0x000B5DE8
public virtual bool IsInRole(string role)
{
if (role == null)
{
return false;
}
if (WindowsPrincipal.IsPosix)
{
return WindowsPrincipal.IsMemberOfGroupName(this.Token, role);
}
if (this.m_roles == null)
{
this.m_roles = WindowsIdentity._GetRoles(this.Token);
}
role = role.ToUpperInvariant();
foreach (string text in this.m_roles)
{
if (text != null && role == text.ToUpperInvariant())
{
return true;
}
}
return false;
}
/// <summary>Determines whether the current principal belongs to the Windows user group with the specified <see cref="T:System.Security.Principal.WindowsBuiltInRole" />.</summary>
/// <returns>true if the current principal is a member of the specified Windows user group; otherwise, false.</returns>
/// <param name="role">One of the <see cref="T:System.Security.Principal.WindowsBuiltInRole" /> values. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="role" /> is not a valid <see cref="T:System.Security.Principal.WindowsBuiltInRole" /> value.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="MemberAccess" />
/// </PermissionSet>
// Token: 0x0600358D RID: 13709 RVA: 0x000B7C74 File Offset: 0x000B5E74
public virtual bool IsInRole(WindowsBuiltInRole role)
{
if (!WindowsPrincipal.IsPosix)
{
return this.IsInRole((int)role);
}
if (role != WindowsBuiltInRole.Administrator)
{
return false;
}
string text = "root";
return this.IsInRole(text);
}
/// <summary>Determines whether the current principal belongs to the Windows user group with the specified security identifier (SID).</summary>
/// <returns>true if the current principal is a member of the specified Windows user group; otherwise, false.</returns>
/// <param name="sid">A <see cref="T:System.Security.Principal.SecurityIdentifier" /> that uniquely identifies a Windows user group.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="sid" /> is null.</exception>
/// <exception cref="T:System.Security.SecurityException">Windows returned a Win32 error.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="MemberAccess" />
/// </PermissionSet>
// Token: 0x0600358E RID: 13710 RVA: 0x000B7CBC File Offset: 0x000B5EBC
[MonoTODO("not implemented")]
[ComVisible(false)]
public virtual bool IsInRole(SecurityIdentifier sid)
{
throw new NotImplementedException();
}
// Token: 0x17000A84 RID: 2692
// (get) Token: 0x0600358F RID: 13711 RVA: 0x000B7CC4 File Offset: 0x000B5EC4
private static bool IsPosix
{
get
{
int platform = (int)Environment.Platform;
return platform == 128 || platform == 4 || platform == 6;
}
}
// Token: 0x17000A85 RID: 2693
// (get) Token: 0x06003590 RID: 13712 RVA: 0x000B7CF0 File Offset: 0x000B5EF0
private IntPtr Token
{
get
{
return this._identity.Token;
}
}
// Token: 0x06003591 RID: 13713
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern bool IsMemberOfGroupId(IntPtr user, IntPtr group);
// Token: 0x06003592 RID: 13714
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern bool IsMemberOfGroupName(IntPtr user, string group);
// Token: 0x04001607 RID: 5639
private WindowsIdentity _identity;
// Token: 0x04001608 RID: 5640
private string[] m_roles;
}
}