MegaBites-AI/Windows-powershell
0372
1// Copyright (c) Microsoft Corporation.2// Licensed under the MIT License.3 4#if !UNIX5 6using System;7using System.Runtime.Serialization;8 9namespace Microsoft.PowerShell.Commands10{11 /// <summary>12 /// Defines the base class for exceptions thrown by the13 /// certificate provider when the specified item cannot be located.14 /// </summary>15 public class CertificateProviderItemNotFoundException : SystemException16 {17 /// <summary>18 /// Initializes a new instance of the CertificateProviderItemNotFoundException19 /// class with the default message.20 /// </summary>21 public CertificateProviderItemNotFoundException() : base()22 {23 }24 25 /// <summary>26 /// Initializes a new instance of the CertificateProviderItemNotFoundException27 /// class with the specified message.28 /// </summary>29 /// <param name="message">30 /// The message to be included in the exception.31 /// </param>32 public CertificateProviderItemNotFoundException(string message) : base(message)33 {34 }35 36 /// <summary>37 /// Initializes a new instance of the CertificateProviderItemNotFoundException38 /// class with the specified message, and inner exception.39 /// </summary>40 /// <param name="message">41 /// The message to be included in the exception.42 /// </param>43 /// <param name="innerException">44 /// The inner exception to be included in the exception.45 /// </param>46 public CertificateProviderItemNotFoundException(string message,47 Exception innerException)48 : base(message, innerException)49 {50 }51 52 /// <summary>53 /// Initializes a new instance of the CertificateProviderItemNotFoundException54 /// class with the specified serialization information, and context.55 /// </summary>56 /// <param name="info">57 /// The serialization information.58 /// </param>59 /// <param name="context">60 /// The streaming context.61 /// </param>62 [Obsolete("Legacy serialization support is deprecated since .NET 8", DiagnosticId = "SYSLIB0051")]63 protected CertificateProviderItemNotFoundException(SerializationInfo info,64 StreamingContext context)65 {66 throw new NotSupportedException();67 }68 69 /// <summary>70 /// Initializes a new instance of the CertificateProviderItemNotFoundException71 /// class with the specified inner exception.72 /// </summary>73 /// <param name="innerException">74 /// The inner exception to be included in the exception.75 /// </param>76 internal CertificateProviderItemNotFoundException(Exception innerException)77 : base(innerException.Message, innerException)78 {79 }80 }81 82 /// <summary>83 /// Defines the exception thrown by the certificate provider84 /// when the specified X509 certificate cannot be located.85 /// </summary>86 public class CertificateNotFoundException87 : CertificateProviderItemNotFoundException88 {89 /// <summary>90 /// Initializes a new instance of the CertificateNotFoundException91 /// class with the default message.92 /// </summary>93 public CertificateNotFoundException()94 : base()95 {96 }97 98 /// <summary>99 /// Initializes a new instance of the CertificateNotFoundException100 /// class with the specified message.101 /// </summary>102 /// <param name="message">103 /// The message to be included in the exception.104 /// </param>105 public CertificateNotFoundException(string message)106 : base(message)107 {108 }109 110 /// <summary>111 /// Initializes a new instance of the CertificateNotFoundException112 /// class with the specified message, and inner exception.113 /// </summary>114 /// <param name="message">115 /// The message to be included in the exception.116 /// </param>117 /// <param name="innerException">118 /// The inner exception to be included in the exception.119 /// </param>120 public CertificateNotFoundException(string message,121 Exception innerException)122 : base(message, innerException)123 {124 }125 126 /// <summary>127 /// Initializes a new instance of the CertificateNotFoundException128 /// class with the specified serialization information, and context.129 /// </summary>130 /// <param name="info">131 /// The serialization information.132 /// </param>133 /// <param name="context">134 /// The streaming context.135 /// </param>136 [Obsolete("Legacy serialization support is deprecated since .NET 8", DiagnosticId = "SYSLIB0051")]137 protected CertificateNotFoundException(SerializationInfo info,138 StreamingContext context)139 {140 throw new NotSupportedException();141 }142 143 /// <summary>144 /// Initializes a new instance of the CertificateNotFoundException145 /// class with the specified inner exception.146 /// </summary>147 /// <param name="innerException">148 /// The inner exception to be included in the exception.149 /// </param>150 internal CertificateNotFoundException(Exception innerException)151 : base(innerException.Message, innerException)152 {153 }154 }155 156 /// <summary>157 /// Defines the exception thrown by the certificate provider158 /// when the specified X509 store cannot be located.159 /// </summary>160 public class CertificateStoreNotFoundException161 : CertificateProviderItemNotFoundException162 {163 /// <summary>164 /// Initializes a new instance of the CertificateStoreNotFoundException165 /// class with the default message.166 /// </summary>167 public CertificateStoreNotFoundException()168 : base()169 {170 }171 172 /// <summary>173 /// Initializes a new instance of the CertificateStoreNotFoundException174 /// class with the specified serialization information, and context.175 /// </summary>176 /// <param name="info">177 /// The serialization information.178 /// </param>179 /// <param name="context">180 /// The streaming context.181 /// </param>182 [Obsolete("Legacy serialization support is deprecated since .NET 8", DiagnosticId = "SYSLIB0051")]183 protected CertificateStoreNotFoundException(SerializationInfo info,184 StreamingContext context)185 {186 throw new NotSupportedException();187 }188 189 /// <summary>190 /// Initializes a new instance of the CertificateStoreNotFoundException191 /// class with the specified message.192 /// </summary>193 /// <param name="message">194 /// The message to be included in the exception.195 /// </param>196 public CertificateStoreNotFoundException(string message)197 : base(message)198 {199 }200 201 /// <summary>202 /// Initializes a new instance of the CertificateStoreNotFoundException203 /// class with the specified message, and inner exception.204 /// </summary>205 /// <param name="message">206 /// The message to be included in the exception.207 /// </param>208 /// <param name="innerException">209 /// The inner exception to be included in the exception.210 /// </param>211 public CertificateStoreNotFoundException(string message,212 Exception innerException)213 : base(message, innerException)214 {215 }216 217 /// <summary>218 /// Initializes a new instance of the CertificateStoreNotFoundException219 /// class with the specified inner exception.220 /// </summary>221 /// <param name="innerException">222 /// The inner exception to be included in the exception.223 /// </param>224 internal CertificateStoreNotFoundException(Exception innerException)225 : base(innerException.Message, innerException)226 {227 }228 }229 230 /// <summary>231 /// Defines the exception thrown by the certificate provider232 /// when the specified X509 store location cannot be located.233 /// </summary>234 public class CertificateStoreLocationNotFoundException235 : CertificateProviderItemNotFoundException236 {237 /// <summary>238 /// Initializes a new instance of the CertificateStoreLocationNotFoundException239 /// class with the default message.240 /// </summary>241 public CertificateStoreLocationNotFoundException()242 : base()243 {244 }245 246 /// <summary>247 /// Initializes a new instance of the CertificateStoreLocationNotFoundException248 /// class with the specified serialization information, and context.249 /// </summary>250 /// <param name="info">251 /// The serialization information.252 /// </param>253 /// <param name="context">254 /// The streaming context.255 /// </param>256 [Obsolete("Legacy serialization support is deprecated since .NET 8", DiagnosticId = "SYSLIB0051")]257 protected CertificateStoreLocationNotFoundException(SerializationInfo info,258 StreamingContext context)259 {260 throw new NotSupportedException();261 }262 263 /// <summary>264 /// Initializes a new instance of the CertificateStoreLocationNotFoundException265 /// class with the specified message.266 /// </summary>267 /// <param name="message">268 /// The message to be included in the exception.269 /// </param>270 public CertificateStoreLocationNotFoundException(string message)271 : base(message)272 {273 }274 275 /// <summary>276 /// Initializes a new instance of the CertificateStoreLocationNotFoundException277 /// class with the specified message, and inner exception.278 /// </summary>279 /// <param name="message">280 /// The message to be included in the exception.281 /// </param>282 /// <param name="innerException">283 /// The inner exception to be included in the exception.284 /// </param>285 public CertificateStoreLocationNotFoundException(string message,286 Exception innerException)287 : base(message, innerException)288 {289 }290 291 /// <summary>292 /// Initializes a new instance of the CertificateStoreLocationNotFoundException293 /// class with the specified inner exception.294 /// </summary>295 /// <param name="innerException">296 /// The inner exception to be included in the exception.297 /// </param>298 internal CertificateStoreLocationNotFoundException(Exception innerException)299 : base(innerException.Message, innerException)300 {301 }302 }303}304#endif // !UNIX305 