mscorlib(4.0.0.0) API with additions
SecurityException.cs
2 using System.IO;
3 using System.Reflection;
9 using System.Security.Util;
10 using System.Text;
11 using System.Threading;
12 
13 namespace System.Security
14 {
16  [Serializable]
17  [ComVisible(true)]
18  [__DynamicallyInvokable]
20  {
21  private string m_debugString;
22 
23  private SecurityAction m_action;
24 
25  [NonSerialized]
26  private Type m_typeOfPermissionThatFailed;
27 
28  private string m_permissionThatFailed;
29 
30  private string m_demanded;
31 
32  private string m_granted;
33 
34  private string m_refused;
35 
36  private string m_denied;
37 
38  private string m_permitOnly;
39 
40  private AssemblyName m_assemblyName;
41 
42  private byte[] m_serializedMethodInfo;
43 
44  private string m_strMethodInfo;
45 
46  private SecurityZone m_zone;
47 
48  private string m_url;
49 
50  private const string ActionName = "Action";
51 
52  private const string FirstPermissionThatFailedName = "FirstPermissionThatFailed";
53 
54  private const string DemandedName = "Demanded";
55 
56  private const string GrantedSetName = "GrantedSet";
57 
58  private const string RefusedSetName = "RefusedSet";
59 
60  private const string DeniedName = "Denied";
61 
62  private const string PermitOnlyName = "PermitOnly";
63 
64  private const string Assembly_Name = "Assembly";
65 
66  private const string MethodName_Serialized = "Method";
67 
68  private const string MethodName_String = "Method_String";
69 
70  private const string ZoneName = "Zone";
71 
72  private const string UrlName = "Url";
73 
76  [ComVisible(false)]
77  public SecurityAction Action
78  {
79  get
80  {
81  return m_action;
82  }
83  set
84  {
85  m_action = value;
86  }
87  }
88 
91  public Type PermissionType
92  {
93  [SecuritySafeCritical]
94  get
95  {
96  if (m_typeOfPermissionThatFailed == null)
97  {
98  object obj = XMLUtil.XmlStringToSecurityObject(m_permissionThatFailed);
99  if (obj == null)
100  {
101  obj = XMLUtil.XmlStringToSecurityObject(m_demanded);
102  }
103  if (obj != null)
104  {
105  m_typeOfPermissionThatFailed = obj.GetType();
106  }
107  }
108  return m_typeOfPermissionThatFailed;
109  }
110  set
111  {
112  m_typeOfPermissionThatFailed = value;
113  }
114  }
115 
119  {
120  [SecuritySafeCritical]
121  [SecurityPermission(SecurityAction.Demand, Flags = (SecurityPermissionFlag.ControlEvidence | SecurityPermissionFlag.ControlPolicy))]
122  get
123  {
124  return (IPermission)XMLUtil.XmlStringToSecurityObject(m_permissionThatFailed);
125  }
126  set
127  {
128  m_permissionThatFailed = XMLUtil.SecurityObjectToXmlString(value);
129  }
130  }
131 
134  public string PermissionState
135  {
136  [SecuritySafeCritical]
137  [SecurityPermission(SecurityAction.Demand, Flags = (SecurityPermissionFlag.ControlEvidence | SecurityPermissionFlag.ControlPolicy))]
138  get
139  {
140  return m_demanded;
141  }
142  set
143  {
144  m_demanded = value;
145  }
146  }
147 
150  [ComVisible(false)]
151  public object Demanded
152  {
153  [SecuritySafeCritical]
154  [SecurityPermission(SecurityAction.Demand, Flags = (SecurityPermissionFlag.ControlEvidence | SecurityPermissionFlag.ControlPolicy))]
155  get
156  {
157  return XMLUtil.XmlStringToSecurityObject(m_demanded);
158  }
159  set
160  {
161  m_demanded = XMLUtil.SecurityObjectToXmlString(value);
162  }
163  }
164 
167  public string GrantedSet
168  {
169  [SecuritySafeCritical]
170  [SecurityPermission(SecurityAction.Demand, Flags = (SecurityPermissionFlag.ControlEvidence | SecurityPermissionFlag.ControlPolicy))]
171  get
172  {
173  return m_granted;
174  }
175  set
176  {
177  m_granted = value;
178  }
179  }
180 
183  public string RefusedSet
184  {
185  [SecuritySafeCritical]
186  [SecurityPermission(SecurityAction.Demand, Flags = (SecurityPermissionFlag.ControlEvidence | SecurityPermissionFlag.ControlPolicy))]
187  get
188  {
189  return m_refused;
190  }
191  set
192  {
193  m_refused = value;
194  }
195  }
196 
199  [ComVisible(false)]
200  public object DenySetInstance
201  {
202  [SecuritySafeCritical]
203  [SecurityPermission(SecurityAction.Demand, Flags = (SecurityPermissionFlag.ControlEvidence | SecurityPermissionFlag.ControlPolicy))]
204  get
205  {
206  return XMLUtil.XmlStringToSecurityObject(m_denied);
207  }
208  set
209  {
210  m_denied = XMLUtil.SecurityObjectToXmlString(value);
211  }
212  }
213 
216  [ComVisible(false)]
217  public object PermitOnlySetInstance
218  {
219  [SecuritySafeCritical]
220  [SecurityPermission(SecurityAction.Demand, Flags = (SecurityPermissionFlag.ControlEvidence | SecurityPermissionFlag.ControlPolicy))]
221  get
222  {
223  return XMLUtil.XmlStringToSecurityObject(m_permitOnly);
224  }
225  set
226  {
227  m_permitOnly = XMLUtil.SecurityObjectToXmlString(value);
228  }
229  }
230 
233  [ComVisible(false)]
235  {
236  [SecuritySafeCritical]
237  [SecurityPermission(SecurityAction.Demand, Flags = (SecurityPermissionFlag.ControlEvidence | SecurityPermissionFlag.ControlPolicy))]
238  get
239  {
240  return m_assemblyName;
241  }
242  set
243  {
244  m_assemblyName = value;
245  }
246  }
247 
250  [ComVisible(false)]
251  public MethodInfo Method
252  {
253  [SecuritySafeCritical]
254  [SecurityPermission(SecurityAction.Demand, Flags = (SecurityPermissionFlag.ControlEvidence | SecurityPermissionFlag.ControlPolicy))]
255  get
256  {
257  return getMethod();
258  }
259  set
260  {
261  RuntimeMethodInfo runtimeMethodInfo = value as RuntimeMethodInfo;
262  m_serializedMethodInfo = ObjectToByteArray(runtimeMethodInfo);
263  if (runtimeMethodInfo != null)
264  {
265  m_strMethodInfo = runtimeMethodInfo.ToString();
266  }
267  }
268  }
269 
272  public SecurityZone Zone
273  {
274  get
275  {
276  return m_zone;
277  }
278  set
279  {
280  m_zone = value;
281  }
282  }
283 
286  public string Url
287  {
288  [SecuritySafeCritical]
289  [SecurityPermission(SecurityAction.Demand, Flags = (SecurityPermissionFlag.ControlEvidence | SecurityPermissionFlag.ControlPolicy))]
290  get
291  {
292  return m_url;
293  }
294  set
295  {
296  m_url = value;
297  }
298  }
299 
300  [SecuritySafeCritical]
301  internal static string GetResString(string sResourceName)
302  {
303  PermissionSet.s_fullTrust.Assert();
304  return Environment.GetResourceString(sResourceName);
305  }
306 
307  [SecurityCritical]
308  internal static Exception MakeSecurityException(AssemblyName asmName, Evidence asmEvidence, PermissionSet granted, PermissionSet refused, RuntimeMethodHandleInternal rmh, SecurityAction action, object demand, IPermission permThatFailed)
309  {
310  HostProtectionPermission hostProtectionPermission = permThatFailed as HostProtectionPermission;
311  if (hostProtectionPermission != null)
312  {
313  return new HostProtectionException(GetResString("HostProtection_HostProtection"), HostProtectionPermission.protectedResources, hostProtectionPermission.Resources);
314  }
315  string message = "";
316  MethodInfo method = null;
317  try
318  {
319  message = ((granted == null && refused == null && demand == null) ? GetResString("Security_NoAPTCA") : ((demand != null && demand is IPermission) ? string.Format(CultureInfo.InvariantCulture, GetResString("Security_Generic"), demand.GetType().AssemblyQualifiedName) : ((permThatFailed == null) ? GetResString("Security_GenericNoType") : string.Format(CultureInfo.InvariantCulture, GetResString("Security_Generic"), permThatFailed.GetType().AssemblyQualifiedName))));
320  method = SecurityRuntime.GetMethodInfo(rmh);
321  }
322  catch (Exception ex)
323  {
324  if (ex is ThreadAbortException)
325  {
326  throw;
327  }
328  }
329  return new SecurityException(message, asmName, granted, refused, method, action, demand, permThatFailed, asmEvidence);
330  }
331 
332  private static byte[] ObjectToByteArray(object obj)
333  {
334  if (obj == null)
335  {
336  return null;
337  }
338  MemoryStream memoryStream = new MemoryStream();
339  BinaryFormatter binaryFormatter = new BinaryFormatter();
340  try
341  {
342  binaryFormatter.Serialize(memoryStream, obj);
343  return memoryStream.ToArray();
344  }
345  catch (NotSupportedException)
346  {
347  return null;
348  }
349  }
350 
351  private static object ByteArrayToObject(byte[] array)
352  {
353  if (array == null || array.Length == 0)
354  {
355  return null;
356  }
357  MemoryStream serializationStream = new MemoryStream(array);
358  BinaryFormatter binaryFormatter = new BinaryFormatter();
359  return binaryFormatter.Deserialize(serializationStream);
360  }
361 
363  [__DynamicallyInvokable]
365  : base(GetResString("Arg_SecurityException"))
366  {
367  SetErrorCode(-2146233078);
368  }
369 
372  [__DynamicallyInvokable]
373  public SecurityException(string message)
374  : base(message)
375  {
376  SetErrorCode(-2146233078);
377  }
378 
382  [SecuritySafeCritical]
383  public SecurityException(string message, Type type)
384  : base(message)
385  {
386  PermissionSet.s_fullTrust.Assert();
387  SetErrorCode(-2146233078);
388  m_typeOfPermissionThatFailed = type;
389  }
390 
395  [SecuritySafeCritical]
396  public SecurityException(string message, Type type, string state)
397  : base(message)
398  {
399  PermissionSet.s_fullTrust.Assert();
400  SetErrorCode(-2146233078);
401  m_typeOfPermissionThatFailed = type;
402  m_demanded = state;
403  }
404 
408  [__DynamicallyInvokable]
409  public SecurityException(string message, Exception inner)
410  : base(message, inner)
411  {
412  SetErrorCode(-2146233078);
413  }
414 
415  [SecurityCritical]
416  internal SecurityException(PermissionSet grantedSetObj, PermissionSet refusedSetObj)
417  : base(GetResString("Arg_SecurityException"))
418  {
419  PermissionSet.s_fullTrust.Assert();
420  SetErrorCode(-2146233078);
421  if (grantedSetObj != null)
422  {
423  m_granted = grantedSetObj.ToXml().ToString();
424  }
425  if (refusedSetObj != null)
426  {
427  m_refused = refusedSetObj.ToXml().ToString();
428  }
429  }
430 
431  [SecurityCritical]
432  internal SecurityException(string message, PermissionSet grantedSetObj, PermissionSet refusedSetObj)
433  : base(message)
434  {
435  PermissionSet.s_fullTrust.Assert();
436  SetErrorCode(-2146233078);
437  if (grantedSetObj != null)
438  {
439  m_granted = grantedSetObj.ToXml().ToString();
440  }
441  if (refusedSetObj != null)
442  {
443  m_refused = refusedSetObj.ToXml().ToString();
444  }
445  }
446 
452  [SecuritySafeCritical]
454  : base(info, context)
455  {
456  if (info == null)
457  {
458  throw new ArgumentNullException("info");
459  }
460  try
461  {
462  m_action = (SecurityAction)info.GetValue("Action", typeof(SecurityAction));
463  m_permissionThatFailed = (string)info.GetValueNoThrow("FirstPermissionThatFailed", typeof(string));
464  m_demanded = (string)info.GetValueNoThrow("Demanded", typeof(string));
465  m_granted = (string)info.GetValueNoThrow("GrantedSet", typeof(string));
466  m_refused = (string)info.GetValueNoThrow("RefusedSet", typeof(string));
467  m_denied = (string)info.GetValueNoThrow("Denied", typeof(string));
468  m_permitOnly = (string)info.GetValueNoThrow("PermitOnly", typeof(string));
469  m_assemblyName = (AssemblyName)info.GetValueNoThrow("Assembly", typeof(AssemblyName));
470  m_serializedMethodInfo = (byte[])info.GetValueNoThrow("Method", typeof(byte[]));
471  m_strMethodInfo = (string)info.GetValueNoThrow("Method_String", typeof(string));
472  m_zone = (SecurityZone)info.GetValue("Zone", typeof(SecurityZone));
473  m_url = (string)info.GetValueNoThrow("Url", typeof(string));
474  }
475  catch
476  {
477  m_action = (SecurityAction)0;
478  m_permissionThatFailed = "";
479  m_demanded = "";
480  m_granted = "";
481  m_refused = "";
482  m_denied = "";
483  m_permitOnly = "";
484  m_assemblyName = null;
485  m_serializedMethodInfo = null;
486  m_strMethodInfo = null;
487  m_zone = SecurityZone.NoZone;
488  m_url = "";
489  }
490  }
491 
502  [SecuritySafeCritical]
503  public SecurityException(string message, AssemblyName assemblyName, PermissionSet grant, PermissionSet refused, MethodInfo method, SecurityAction action, object demanded, IPermission permThatFailed, Evidence evidence)
504  : base(message)
505  {
506  PermissionSet.s_fullTrust.Assert();
507  SetErrorCode(-2146233078);
508  Action = action;
509  if (permThatFailed != null)
510  {
511  m_typeOfPermissionThatFailed = permThatFailed.GetType();
512  }
513  FirstPermissionThatFailed = permThatFailed;
514  Demanded = demanded;
515  m_granted = ((grant == null) ? "" : grant.ToXml().ToString());
516  m_refused = ((refused == null) ? "" : refused.ToXml().ToString());
517  m_denied = "";
518  m_permitOnly = "";
519  m_assemblyName = assemblyName;
520  Method = method;
521  m_url = "";
522  m_zone = SecurityZone.NoZone;
523  if (evidence != null)
524  {
525  Url hostEvidence = evidence.GetHostEvidence<Url>();
526  if (hostEvidence != null)
527  {
528  m_url = hostEvidence.GetURLString().ToString();
529  }
530  Zone hostEvidence2 = evidence.GetHostEvidence<Zone>();
531  if (hostEvidence2 != null)
532  {
533  m_zone = hostEvidence2.SecurityZone;
534  }
535  }
536  m_debugString = ToString(includeSensitiveInfo: true, includeBaseInfo: false);
537  }
538 
546  [SecuritySafeCritical]
547  public SecurityException(string message, object deny, object permitOnly, MethodInfo method, object demanded, IPermission permThatFailed)
548  : base(message)
549  {
550  PermissionSet.s_fullTrust.Assert();
551  SetErrorCode(-2146233078);
552  Action = SecurityAction.Demand;
553  if (permThatFailed != null)
554  {
555  m_typeOfPermissionThatFailed = permThatFailed.GetType();
556  }
557  FirstPermissionThatFailed = permThatFailed;
558  Demanded = demanded;
559  m_granted = "";
560  m_refused = "";
561  DenySetInstance = deny;
562  PermitOnlySetInstance = permitOnly;
563  m_assemblyName = null;
564  Method = method;
565  m_zone = SecurityZone.NoZone;
566  m_url = "";
567  m_debugString = ToString(includeSensitiveInfo: true, includeBaseInfo: false);
568  }
569 
570  private MethodInfo getMethod()
571  {
572  return (MethodInfo)ByteArrayToObject(m_serializedMethodInfo);
573  }
574 
575  private void ToStringHelper(StringBuilder sb, string resourceString, object attr)
576  {
577  if (attr != null)
578  {
579  string text = attr as string;
580  if (text == null)
581  {
582  text = attr.ToString();
583  }
584  if (text.Length != 0)
585  {
586  sb.Append(Environment.NewLine);
587  sb.Append(GetResString(resourceString));
588  sb.Append(Environment.NewLine);
589  sb.Append(text);
590  }
591  }
592  }
593 
594  [SecurityCritical]
595  private string ToString(bool includeSensitiveInfo, bool includeBaseInfo)
596  {
597  PermissionSet.s_fullTrust.Assert();
598  StringBuilder stringBuilder = new StringBuilder();
599  if (includeBaseInfo)
600  {
601  stringBuilder.Append(base.ToString());
602  }
603  if (Action > (SecurityAction)0)
604  {
605  ToStringHelper(stringBuilder, "Security_Action", Action);
606  }
607  ToStringHelper(stringBuilder, "Security_TypeFirstPermThatFailed", PermissionType);
608  if (includeSensitiveInfo)
609  {
610  ToStringHelper(stringBuilder, "Security_FirstPermThatFailed", m_permissionThatFailed);
611  ToStringHelper(stringBuilder, "Security_Demanded", m_demanded);
612  ToStringHelper(stringBuilder, "Security_GrantedSet", m_granted);
613  ToStringHelper(stringBuilder, "Security_RefusedSet", m_refused);
614  ToStringHelper(stringBuilder, "Security_Denied", m_denied);
615  ToStringHelper(stringBuilder, "Security_PermitOnly", m_permitOnly);
616  ToStringHelper(stringBuilder, "Security_Assembly", m_assemblyName);
617  ToStringHelper(stringBuilder, "Security_Method", m_strMethodInfo);
618  }
619  if (m_zone != SecurityZone.NoZone)
620  {
621  ToStringHelper(stringBuilder, "Security_Zone", m_zone);
622  }
623  if (includeSensitiveInfo)
624  {
625  ToStringHelper(stringBuilder, "Security_Url", m_url);
626  }
627  return stringBuilder.ToString();
628  }
629 
630  [SecurityCritical]
631  private bool CanAccessSensitiveInfo()
632  {
633  bool result = false;
634  try
635  {
636  new SecurityPermission(SecurityPermissionFlag.ControlEvidence | SecurityPermissionFlag.ControlPolicy).Demand();
637  result = true;
638  return result;
639  }
640  catch (SecurityException)
641  {
642  return result;
643  }
644  }
645 
648  [SecuritySafeCritical]
649  [__DynamicallyInvokable]
650  public override string ToString()
651  {
652  return ToString(CanAccessSensitiveInfo(), includeBaseInfo: true);
653  }
654 
659  [SecurityCritical]
660  public override void GetObjectData(SerializationInfo info, StreamingContext context)
661  {
662  if (info == null)
663  {
664  throw new ArgumentNullException("info");
665  }
666  base.GetObjectData(info, context);
667  info.AddValue("Action", m_action, typeof(SecurityAction));
668  info.AddValue("FirstPermissionThatFailed", m_permissionThatFailed, typeof(string));
669  info.AddValue("Demanded", m_demanded, typeof(string));
670  info.AddValue("GrantedSet", m_granted, typeof(string));
671  info.AddValue("RefusedSet", m_refused, typeof(string));
672  info.AddValue("Denied", m_denied, typeof(string));
673  info.AddValue("PermitOnly", m_permitOnly, typeof(string));
674  info.AddValue("Assembly", m_assemblyName, typeof(AssemblyName));
675  info.AddValue("Method", m_serializedMethodInfo, typeof(byte[]));
676  info.AddValue("Method_String", m_strMethodInfo, typeof(string));
677  info.AddValue("Zone", m_zone, typeof(SecurityZone));
678  info.AddValue("Url", m_url, typeof(string));
679  }
680  }
681 }
SecurityException(string message, Type type, string state)
Initializes a new instance of the T:System.Security.SecurityException class with a specified error me...
static CultureInfo InvariantCulture
Gets the T:System.Globalization.CultureInfo object that is culture-independent (invariant).
Definition: CultureInfo.cs:263
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
Describes a set of security permissions applied to code. This class cannot be inherited.
AssemblyName FailedAssemblyInfo
Gets or sets information about the failed assembly.
unsafe override string ToString()
Converts the value of this instance to a T:System.String.
object Demanded
Gets or sets the demanded security permission, permission set, or permission set collection that fail...
object PermitOnlySetInstance
Gets or sets the permission, permission set, or permission set collection that is part of the permit-...
SecurityZone
Defines the integer values corresponding to security zones used by security policy.
Definition: SecurityZone.cs:8
Discovers the attributes of a method and provides access to method metadata.
Definition: MethodInfo.cs:13
Serves as the base class for system exceptions namespace.
Provides the security zone of a code assembly as evidence for policy evaluation. This class cannot be...
Definition: Zone.cs:10
SecurityException(string message, Exception inner)
Initializes a new instance of the T:System.Security.SecurityException class with a specified error me...
void Serialize(Stream serializationStream, object graph)
Serializes the object, or graph of objects with the specified top (root), to the given stream.
string RefusedSet
Gets or sets the refused permission set of the assembly that caused the T:System.Security....
SecurityException(string message, AssemblyName assemblyName, PermissionSet grant, PermissionSet refused, MethodInfo method, SecurityAction action, object demanded, IPermission permThatFailed, Evidence evidence)
Initializes a new instance of the T:System.Security.SecurityException class for an exception caused b...
Definition: __Canon.cs:3
new Type GetType()
Gets the runtime type of the current instance.
Definition: Exception.cs:753
object DenySetInstance
Gets or sets the denied security permission, permission set, or permission set collection that caused...
SecurityException()
Initializes a new instance of the T:System.Security.SecurityException class with default properties.
Provides the URL from which a code assembly originates as evidence for policy evaluation....
Definition: Url.cs:10
Describes the source and destination of a given serialized stream, and provides an additional caller-...
object Deserialize(Stream serializationStream)
Deserializes the specified stream into an object graph.
Serializes and deserializes an object, or an entire graph of connected objects, in binary format.
SecurityAction Action
Gets or sets the security action that caused the exception.
SecurityAction
Specifies the security actions that can be performed using declarative security.
string GrantedSet
Gets or sets the granted permission set of the assembly that caused the T:System.Security....
Provides information about, and means to manipulate, the current environment and platform....
Definition: Environment.cs:21
Creates a stream whose backing store is memory.To browse the .NET Framework source code for this type...
Definition: MemoryStream.cs:13
StringBuilder Append(char value, int repeatCount)
Appends a specified number of copies of the string representation of a Unicode character to this inst...
Represents a collection that can contain many different types of permissions.
virtual byte [] ToArray()
Writes the stream contents to a byte array, regardless of the P:System.IO.MemoryStream....
MethodInfo Method
Gets or sets the information about the method associated with the exception.
SecurityException(SerializationInfo info, StreamingContext context)
Initializes a new instance of the T:System.Security.SecurityException class with serialized data.
Represents type declarations: class types, interface types, array types, value types,...
Definition: Type.cs:18
IPermission FirstPermissionThatFailed
Gets or sets the first permission in a permission set or permission set collection that failed the de...
SecurityException(string message)
Initializes a new instance of the T:System.Security.SecurityException class with a specified error me...
Stores all the data needed to serialize or deserialize an object. This class cannot be inherited.
Defines methods implemented by permission types.
Definition: IPermission.cs:7
Represents a mutable string of characters. This class cannot be inherited.To browse the ....
Describes an assembly's unique identity in full.
Definition: AssemblyName.cs:19
Exception()
Initializes a new instance of the T:System.Exception class.
Definition: Exception.cs:286
void Demand()
Forces a T:System.Security.SecurityException at run time if all callers higher in the call stack have...
override void GetObjectData(SerializationInfo info, StreamingContext context)
Sets the T:System.Runtime.Serialization.SerializationInfo with information about the T:System....
PermissionState
Specifies whether a permission should have all or no access to resources at creation.
Represents errors that occur during application execution.To browse the .NET Framework source code fo...
Definition: Exception.cs:22
Defines the set of information that constitutes input to security policy decisions....
Definition: Evidence.cs:17
Specifies that the class can be serialized.
override string ToString()
Returns a representation of the current T:System.Security.SecurityException.
Type PermissionType
Gets or sets the type of the permission that failed.
void Assert()
Declares that the calling code can access the resource protected by a permission demand through the c...
Provides information about a specific culture (called a locale for unmanaged code development)....
Definition: CultureInfo.cs:16
SecurityZone SecurityZone
Gets the zone from which the code assembly originates.
Definition: Zone.cs:30
SecurityPermissionFlag
Specifies access flags for the security permission object.
The exception that is thrown when a call is made to the M:System.Threading.Thread....
The exception that is thrown when a security error is detected.
override string ToString()
Produces a string representation of an XML element and its constituent attributes,...
SecurityException(string message, object deny, object permitOnly, MethodInfo method, object demanded, IPermission permThatFailed)
Initializes a new instance of the T:System.Security.SecurityException class for an exception caused b...
SecurityException(string message, Type type)
Initializes a new instance of the T:System.Security.SecurityException class with a specified error me...