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,528 @@
using System;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Security.Permissions;
using System.Security.Policy;
using System.Text;
namespace System.Security
{
/// <summary>The exception that is thrown when a security error is detected.</summary>
// Token: 0x020005CF RID: 1487
[ComVisible(true)]
[Serializable]
public class SecurityException : SystemException
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.SecurityException" /> class with default properties.</summary>
// Token: 0x06003645 RID: 13893 RVA: 0x000B9FE4 File Offset: 0x000B81E4
public SecurityException()
: base(Locale.GetText("A security error has been detected."))
{
base.HResult = -2146233078;
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.SecurityException" /> class with a specified error message.</summary>
/// <param name="message">The error message that explains the reason for the exception. </param>
// Token: 0x06003646 RID: 13894 RVA: 0x000BA004 File Offset: 0x000B8204
public SecurityException(string message)
: base(message)
{
base.HResult = -2146233078;
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.SecurityException" /> class with serialized data.</summary>
/// <param name="info">The object that holds the serialized object data. </param>
/// <param name="context">The contextual information about the source or destination. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="info " />is null.</exception>
// Token: 0x06003647 RID: 13895 RVA: 0x000BA018 File Offset: 0x000B8218
protected SecurityException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
base.HResult = -2146233078;
SerializationInfoEnumerator enumerator = info.GetEnumerator();
while (enumerator.MoveNext())
{
if (enumerator.Name == "PermissionState")
{
this.permissionState = (string)enumerator.Value;
break;
}
}
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.SecurityException" /> class with a specified error message and a reference to the inner exception that is the cause of this 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 the <paramref name="inner" /> parameter is not null, the current exception is raised in a catch block that handles the inner exception. </param>
// Token: 0x06003648 RID: 13896 RVA: 0x000BA07C File Offset: 0x000B827C
public SecurityException(string message, Exception inner)
: base(message, inner)
{
base.HResult = -2146233078;
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.SecurityException" /> class with a specified error message and the permission type that caused the exception to be thrown.</summary>
/// <param name="message">The error message that explains the reason for the exception. </param>
/// <param name="type">The type of the permission that caused the exception to be thrown. </param>
// Token: 0x06003649 RID: 13897 RVA: 0x000BA094 File Offset: 0x000B8294
public SecurityException(string message, Type type)
: base(message)
{
base.HResult = -2146233078;
this.permissionType = type;
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.SecurityException" /> class with a specified error message, the permission type that caused the exception to be thrown, and the permission state.</summary>
/// <param name="message">The error message that explains the reason for the exception. </param>
/// <param name="type">The type of the permission that caused the exception to be thrown. </param>
/// <param name="state">The state of the permission that caused the exception to be thrown. </param>
// Token: 0x0600364A RID: 13898 RVA: 0x000BA0B0 File Offset: 0x000B82B0
public SecurityException(string message, Type type, string state)
: base(message)
{
base.HResult = -2146233078;
this.permissionType = type;
this.permissionState = state;
}
// Token: 0x0600364B RID: 13899 RVA: 0x000BA0E0 File Offset: 0x000B82E0
internal SecurityException(string message, PermissionSet granted, PermissionSet refused)
: base(message)
{
base.HResult = -2146233078;
this._granted = granted.ToString();
this._refused = refused.ToString();
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.SecurityException" /> class for an exception caused by a Deny on the stack. </summary>
/// <param name="message">The error message that explains the reason for the exception.</param>
/// <param name="deny">The denied permission or permission set.</param>
/// <param name="permitOnly">The permit-only permission or permission set.</param>
/// <param name="method">A <see cref="T:System.Reflection.MethodInfo" /> that identifies the method that encountered the exception.</param>
/// <param name="demanded">The demanded permission, permission set, or permission set collection.</param>
/// <param name="permThatFailed">An <see cref="T:System.Security.IPermission" /> that identifies the permission that failed.</param>
// Token: 0x0600364C RID: 13900 RVA: 0x000BA118 File Offset: 0x000B8318
public SecurityException(string message, object deny, object permitOnly, MethodInfo method, object demanded, IPermission permThatFailed)
: base(message)
{
base.HResult = -2146233078;
this._denyset = deny;
this._permitset = permitOnly;
this._method = method;
this._demanded = demanded;
this._firstperm = permThatFailed;
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.SecurityException" /> class for an exception caused by an insufficient grant set. </summary>
/// <param name="message">The error message that explains the reason for the exception.</param>
/// <param name="assemblyName">An <see cref="T:System.Reflection.AssemblyName" /> that specifies the name of the assembly that caused the exception.</param>
/// <param name="grant">A <see cref="T:System.Security.PermissionSet" /> that represents the permissions granted the assembly.</param>
/// <param name="refused">A <see cref="T:System.Security.PermissionSet" /> that represents the refused permission or permission set.</param>
/// <param name="method">A <see cref="T:System.Reflection.MethodInfo" /> that represents the method that encountered the exception.</param>
/// <param name="action">One of the <see cref="T:System.Security.Permissions.SecurityAction" /> values.</param>
/// <param name="demanded">The demanded permission, permission set, or permission set collection.</param>
/// <param name="permThatFailed">An <see cref="T:System.Security.IPermission" /> that represents the permission that failed.</param>
/// <param name="evidence">The <see cref="T:System.Security.Policy.Evidence" /> for the assembly that caused the exception.</param>
// Token: 0x0600364D RID: 13901 RVA: 0x000BA160 File Offset: 0x000B8360
public SecurityException(string message, AssemblyName assemblyName, PermissionSet grant, PermissionSet refused, MethodInfo method, SecurityAction action, object demanded, IPermission permThatFailed, Evidence evidence)
: base(message)
{
base.HResult = -2146233078;
this._assembly = assemblyName;
this._granted = ((grant != null) ? grant.ToString() : string.Empty);
this._refused = ((refused != null) ? refused.ToString() : string.Empty);
this._method = method;
this._action = action;
this._demanded = demanded;
this._firstperm = permThatFailed;
if (this._firstperm != null)
{
this.permissionType = this._firstperm.GetType();
}
this._evidence = evidence;
}
/// <summary>Gets or sets the security action that caused the exception.</summary>
/// <returns>One of the <see cref="T:System.Security.Permissions.SecurityAction" /> values.</returns>
// Token: 0x17000A9B RID: 2715
// (get) Token: 0x0600364E RID: 13902 RVA: 0x000BA204 File Offset: 0x000B8404
// (set) Token: 0x0600364F RID: 13903 RVA: 0x000BA20C File Offset: 0x000B840C
[ComVisible(false)]
public SecurityAction Action
{
get
{
return this._action;
}
set
{
this._action = value;
}
}
/// <summary>Gets or sets the denied security permission, permission set, or permission set collection that caused a demand to fail.</summary>
/// <returns>A permission, permission set, or permission set collection object.</returns>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence, ControlPolicy" />
/// </PermissionSet>
// Token: 0x17000A9C RID: 2716
// (get) Token: 0x06003650 RID: 13904 RVA: 0x000BA218 File Offset: 0x000B8418
// (set) Token: 0x06003651 RID: 13905 RVA: 0x000BA220 File Offset: 0x000B8420
[ComVisible(false)]
public object DenySetInstance
{
get
{
return this._denyset;
}
set
{
this._denyset = value;
}
}
/// <summary>Gets or sets information about the failed assembly.</summary>
/// <returns>An <see cref="T:System.Reflection.AssemblyName" /> that identifies the failed assembly.</returns>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence, ControlPolicy" />
/// </PermissionSet>
// Token: 0x17000A9D RID: 2717
// (get) Token: 0x06003652 RID: 13906 RVA: 0x000BA22C File Offset: 0x000B842C
// (set) Token: 0x06003653 RID: 13907 RVA: 0x000BA234 File Offset: 0x000B8434
[ComVisible(false)]
public AssemblyName FailedAssemblyInfo
{
get
{
return this._assembly;
}
set
{
this._assembly = value;
}
}
/// <summary>Gets or sets the information about the method associated with the exception.</summary>
/// <returns>A <see cref="T:System.Reflection.MethodInfo" /> object describing the method.</returns>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence, ControlPolicy" />
/// </PermissionSet>
// Token: 0x17000A9E RID: 2718
// (get) Token: 0x06003654 RID: 13908 RVA: 0x000BA240 File Offset: 0x000B8440
// (set) Token: 0x06003655 RID: 13909 RVA: 0x000BA248 File Offset: 0x000B8448
[ComVisible(false)]
public MethodInfo Method
{
get
{
return this._method;
}
set
{
this._method = value;
}
}
/// <summary>Gets or sets the permission, permission set, or permission set collection that is part of the permit-only stack frame that caused a security check to fail.</summary>
/// <returns>A permission, permission set, or permission set collection object.</returns>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence, ControlPolicy" />
/// </PermissionSet>
// Token: 0x17000A9F RID: 2719
// (get) Token: 0x06003656 RID: 13910 RVA: 0x000BA254 File Offset: 0x000B8454
// (set) Token: 0x06003657 RID: 13911 RVA: 0x000BA25C File Offset: 0x000B845C
[ComVisible(false)]
public object PermitOnlySetInstance
{
get
{
return this._permitset;
}
set
{
this._permitset = value;
}
}
/// <summary>Gets or sets the URL of the assembly that caused the exception.</summary>
/// <returns>A URL that identifies the location of the assembly.</returns>
// Token: 0x17000AA0 RID: 2720
// (get) Token: 0x06003658 RID: 13912 RVA: 0x000BA268 File Offset: 0x000B8468
// (set) Token: 0x06003659 RID: 13913 RVA: 0x000BA270 File Offset: 0x000B8470
public string Url
{
get
{
return this._url;
}
set
{
this._url = value;
}
}
/// <summary>Gets or sets the zone of the assembly that caused the exception.</summary>
/// <returns>One of the <see cref="T:System.Security.SecurityZone" /> values that identifies the zone of the assembly that caused the exception.</returns>
// Token: 0x17000AA1 RID: 2721
// (get) Token: 0x0600365A RID: 13914 RVA: 0x000BA27C File Offset: 0x000B847C
// (set) Token: 0x0600365B RID: 13915 RVA: 0x000BA284 File Offset: 0x000B8484
public SecurityZone Zone
{
get
{
return this._zone;
}
set
{
this._zone = value;
}
}
/// <summary>Gets or sets the demanded security permission, permission set, or permission set collection that failed.</summary>
/// <returns>A permission, permission set, or permission set collection object.</returns>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence, ControlPolicy" />
/// </PermissionSet>
// Token: 0x17000AA2 RID: 2722
// (get) Token: 0x0600365C RID: 13916 RVA: 0x000BA290 File Offset: 0x000B8490
// (set) Token: 0x0600365D RID: 13917 RVA: 0x000BA298 File Offset: 0x000B8498
[ComVisible(false)]
public object Demanded
{
get
{
return this._demanded;
}
set
{
this._demanded = value;
}
}
/// <summary>Gets or sets the first permission in a permission set or permission set collection that failed the demand.</summary>
/// <returns>An <see cref="T:System.Security.IPermission" /> object representing the first permission that failed.</returns>
// Token: 0x17000AA3 RID: 2723
// (get) Token: 0x0600365E RID: 13918 RVA: 0x000BA2A4 File Offset: 0x000B84A4
// (set) Token: 0x0600365F RID: 13919 RVA: 0x000BA2AC File Offset: 0x000B84AC
public IPermission FirstPermissionThatFailed
{
get
{
return this._firstperm;
}
set
{
this._firstperm = value;
}
}
/// <summary>Gets or sets the state of the permission that threw the exception.</summary>
/// <returns>The state of the permission at the time the exception was thrown.</returns>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence, ControlPolicy" />
/// </PermissionSet>
// Token: 0x17000AA4 RID: 2724
// (get) Token: 0x06003660 RID: 13920 RVA: 0x000BA2B8 File Offset: 0x000B84B8
// (set) Token: 0x06003661 RID: 13921 RVA: 0x000BA2C0 File Offset: 0x000B84C0
public string PermissionState
{
get
{
return this.permissionState;
}
set
{
this.permissionState = value;
}
}
/// <summary>Gets or sets the type of the permission that failed.</summary>
/// <returns>The type of the permission that failed.</returns>
// Token: 0x17000AA5 RID: 2725
// (get) Token: 0x06003662 RID: 13922 RVA: 0x000BA2CC File Offset: 0x000B84CC
// (set) Token: 0x06003663 RID: 13923 RVA: 0x000BA2D4 File Offset: 0x000B84D4
public Type PermissionType
{
get
{
return this.permissionType;
}
set
{
this.permissionType = value;
}
}
/// <summary>Gets or sets the granted permission set of the assembly that caused the <see cref="T:System.Security.SecurityException" />.</summary>
/// <returns>The XML representation of the granted set of the assembly.</returns>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence, ControlPolicy" />
/// </PermissionSet>
// Token: 0x17000AA6 RID: 2726
// (get) Token: 0x06003664 RID: 13924 RVA: 0x000BA2E0 File Offset: 0x000B84E0
// (set) Token: 0x06003665 RID: 13925 RVA: 0x000BA2E8 File Offset: 0x000B84E8
public string GrantedSet
{
get
{
return this._granted;
}
set
{
this._granted = value;
}
}
/// <summary>Gets or sets the refused permission set of the assembly that caused the <see cref="T:System.Security.SecurityException" />.</summary>
/// <returns>The XML representation of the refused permission set of the assembly.</returns>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence, ControlPolicy" />
/// </PermissionSet>
// Token: 0x17000AA7 RID: 2727
// (get) Token: 0x06003666 RID: 13926 RVA: 0x000BA2F4 File Offset: 0x000B84F4
// (set) Token: 0x06003667 RID: 13927 RVA: 0x000BA2FC File Offset: 0x000B84FC
public string RefusedSet
{
get
{
return this._refused;
}
set
{
this._refused = value;
}
}
/// <summary>Sets the <see cref="T:System.Runtime.Serialization.SerializationInfo" /> with information about the <see cref="T:System.Security.SecurityException" />.</summary>
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data about the exception being thrown. </param>
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="info" /> parameter is null. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Read="*AllFiles*" PathDiscovery="*AllFiles*" />
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence, ControlPolicy" />
/// </PermissionSet>
// Token: 0x06003668 RID: 13928 RVA: 0x000BA308 File Offset: 0x000B8508
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
base.GetObjectData(info, context);
try
{
info.AddValue("PermissionState", this.PermissionState);
}
catch (SecurityException)
{
}
}
/// <summary>Returns a representation of the current <see cref="T:System.Security.SecurityException" />.</summary>
/// <returns>A string representation of the current <see cref="T:System.Security.SecurityException" />.</returns>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Read="*AllFiles*" PathDiscovery="*AllFiles*" />
/// <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="MemberAccess" />
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence, ControlPolicy" />
/// </PermissionSet>
// Token: 0x06003669 RID: 13929 RVA: 0x000BA358 File Offset: 0x000B8558
public override string ToString()
{
StringBuilder stringBuilder = new StringBuilder(base.ToString());
try
{
if (this.permissionType != null)
{
stringBuilder.AppendFormat("{0}Type: {1}", Environment.NewLine, this.PermissionType);
}
if (this._method != null)
{
string text = this._method.ToString();
int num = text.IndexOf(" ") + 1;
stringBuilder.AppendFormat("{0}Method: {1} {2}.{3}", new object[]
{
Environment.NewLine,
this._method.ReturnType.Name,
this._method.ReflectedType,
text.Substring(num)
});
}
if (this.permissionState != null)
{
stringBuilder.AppendFormat("{0}State: {1}", Environment.NewLine, this.PermissionState);
}
if (this._granted != null && this._granted.Length > 0)
{
stringBuilder.AppendFormat("{0}Granted: {1}", Environment.NewLine, this.GrantedSet);
}
if (this._refused != null && this._refused.Length > 0)
{
stringBuilder.AppendFormat("{0}Refused: {1}", Environment.NewLine, this.RefusedSet);
}
if (this._demanded != null)
{
stringBuilder.AppendFormat("{0}Demanded: {1}", Environment.NewLine, this.Demanded);
}
if (this._firstperm != null)
{
stringBuilder.AppendFormat("{0}Failed Permission: {1}", Environment.NewLine, this.FirstPermissionThatFailed);
}
if (this._evidence != null)
{
stringBuilder.AppendFormat("{0}Evidences:", Environment.NewLine);
foreach (object obj in this._evidence)
{
if (!(obj is Hash))
{
stringBuilder.AppendFormat("{0}\t{1}", Environment.NewLine, obj);
}
}
}
}
catch (SecurityException)
{
}
return stringBuilder.ToString();
}
// Token: 0x04001637 RID: 5687
private string permissionState;
// Token: 0x04001638 RID: 5688
private Type permissionType;
// Token: 0x04001639 RID: 5689
private string _granted;
// Token: 0x0400163A RID: 5690
private string _refused;
// Token: 0x0400163B RID: 5691
private object _demanded;
// Token: 0x0400163C RID: 5692
private IPermission _firstperm;
// Token: 0x0400163D RID: 5693
private MethodInfo _method;
// Token: 0x0400163E RID: 5694
private Evidence _evidence;
// Token: 0x0400163F RID: 5695
private SecurityAction _action;
// Token: 0x04001640 RID: 5696
private object _denyset;
// Token: 0x04001641 RID: 5697
private object _permitset;
// Token: 0x04001642 RID: 5698
private AssemblyName _assembly;
// Token: 0x04001643 RID: 5699
private string _url;
// Token: 0x04001644 RID: 5700
private SecurityZone _zone;
}
}