mscorlib(4.0.0.0) API with additions
CryptographicException.cs
1 using Microsoft.Win32;
5 
7 {
10  [ComVisible(true)]
12  {
13  private const int FORMAT_MESSAGE_IGNORE_INSERTS = 512;
14 
15  private const int FORMAT_MESSAGE_FROM_SYSTEM = 4096;
16 
17  private const int FORMAT_MESSAGE_ARGUMENT_ARRAY = 8192;
18 
21  : base(Environment.GetResourceString("Arg_CryptographyException"))
22  {
23  SetErrorCode(-2146233296);
24  }
25 
28  public CryptographicException(string message)
29  : base(message)
30  {
31  SetErrorCode(-2146233296);
32  }
33 
37  public CryptographicException(string format, string insert)
38  : base(string.Format(CultureInfo.CurrentCulture, format, insert))
39  {
40  SetErrorCode(-2146233296);
41  }
42 
46  public CryptographicException(string message, Exception inner)
47  : base(message, inner)
48  {
49  SetErrorCode(-2146233296);
50  }
51 
54  [SecuritySafeCritical]
55  public CryptographicException(int hr)
56  : this(Win32Native.GetMessage(hr))
57  {
58  if ((hr & 2147483648u) != 2147483648u)
59  {
60  hr = ((hr & 0xFFFF) | -2147024896);
61  }
62  SetErrorCode(hr);
63  }
64 
69  : base(info, context)
70  {
71  }
72 
73  private static void ThrowCryptographicException(int hr)
74  {
75  throw new CryptographicException(hr);
76  }
77  }
78 }
The exception that is thrown when an error occurs during a cryptographic operation.
CryptographicException(int hr)
Initializes a new instance of the T:System.Security.Cryptography.CryptographicException class with th...
Serves as the base class for system exceptions namespace.
Definition: __Canon.cs:3
Describes the source and destination of a given serialized stream, and provides an additional caller-...
Provides information about, and means to manipulate, the current environment and platform....
Definition: Environment.cs:21
CryptographicException(string message)
Initializes a new instance of the T:System.Security.Cryptography.CryptographicException class with a ...
CryptographicException(string message, Exception inner)
Initializes a new instance of the T:System.Security.Cryptography.CryptographicException class with a ...
CryptographicException()
Initializes a new instance of the T:System.Security.Cryptography.CryptographicException class with de...
Stores all the data needed to serialize or deserialize an object. This class cannot be inherited.
Represents errors that occur during application execution.To browse the .NET Framework source code fo...
Definition: Exception.cs:22
CryptographicException(SerializationInfo info, StreamingContext context)
Initializes a new instance of the T:System.Security.Cryptography.CryptographicException class with se...
CryptographicException(string format, string insert)
Initializes a new instance of the T:System.Security.Cryptography.CryptographicException class with a ...
Specifies that the class can be serialized.
Compare strings using culture-sensitive sort rules and the current culture.
Provides information about a specific culture (called a locale for unmanaged code development)....
Definition: CultureInfo.cs:16