summary refs log tree commit diff
path: root/crypto/src/util
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2022-06-24 15:07:29 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2022-06-24 15:07:29 +0700
commitb72579c4b1200459f959bcd6a25364e239420573 (patch)
tree5e566cc2b7972cd8ccebece92d879bddc800393d /crypto/src/util
parentRemove certpath from PkixCertPathValidatorException (diff)
downloadBouncyCastle.NET-ed25519-b72579c4b1200459f959bcd6a25364e239420573.tar.xz
Cleanup Exception classes
Diffstat (limited to 'crypto/src/util')
-rw-r--r--crypto/src/util/MemoableResetException.cs35
-rw-r--r--crypto/src/util/io/StreamOverflowException.cs17
-rw-r--r--crypto/src/util/io/pem/PemGenerationException.cs17
3 files changed, 41 insertions, 28 deletions
diff --git a/crypto/src/util/MemoableResetException.cs b/crypto/src/util/MemoableResetException.cs
index 99554f6c2..8a4deb142 100644
--- a/crypto/src/util/MemoableResetException.cs
+++ b/crypto/src/util/MemoableResetException.cs
@@ -1,27 +1,38 @@
 using System;
+using System.Runtime.Serialization;
 
 namespace Org.BouncyCastle.Utilities
 {
-    /**
+	/**
      * Exception to be thrown on a failure to reset an object implementing Memoable.
      * <p>
      * The exception extends InvalidCastException to enable users to have a single handling case,
      * only introducing specific handling of this one if required.
      * </p>
      */
-    public class MemoableResetException
+	[Serializable]
+	public class MemoableResetException
         : InvalidCastException
     {
-        /**
-         * Basic Constructor.
-         *
-         * @param msg message to be associated with this exception.
-         */
-        public MemoableResetException(string msg)
-            : base(msg)
-        {
-        }
-    }
+		public MemoableResetException()
+			: base()
+		{
+		}
 
+		public MemoableResetException(string message)
+			: base(message)
+		{
+		}
+
+		public MemoableResetException(string message, Exception innerException)
+			: base(message, innerException)
+		{
+		}
+
+		protected MemoableResetException(SerializationInfo info, StreamingContext context)
+			: base(info, context)
+		{
+		}
+	}
 }
 
diff --git a/crypto/src/util/io/StreamOverflowException.cs b/crypto/src/util/io/StreamOverflowException.cs
index 7e100e7b5..a36919780 100644
--- a/crypto/src/util/io/StreamOverflowException.cs
+++ b/crypto/src/util/io/StreamOverflowException.cs
@@ -1,11 +1,10 @@
 using System;
 using System.IO;
+using System.Runtime.Serialization;
 
 namespace Org.BouncyCastle.Utilities.IO
 {
-#if !PORTABLE
     [Serializable]
-#endif
     public class StreamOverflowException
 		: IOException
 	{
@@ -14,16 +13,18 @@ namespace Org.BouncyCastle.Utilities.IO
 		{
 		}
 
-		public StreamOverflowException(
-			string message)
+		public StreamOverflowException(string message)
 			: base(message)
 		{
 		}
 
-		public StreamOverflowException(
-			string		message,
-			Exception	exception)
-			: base(message, exception)
+		public StreamOverflowException(string message, Exception innerException)
+			: base(message, innerException)
+		{
+		}
+
+		protected StreamOverflowException(SerializationInfo info, StreamingContext context)
+			: base(info, context)
 		{
 		}
 	}
diff --git a/crypto/src/util/io/pem/PemGenerationException.cs b/crypto/src/util/io/pem/PemGenerationException.cs
index a49dda0e7..b7f30672e 100644
--- a/crypto/src/util/io/pem/PemGenerationException.cs
+++ b/crypto/src/util/io/pem/PemGenerationException.cs
@@ -1,10 +1,9 @@
 using System;
+using System.Runtime.Serialization;
 
 namespace Org.BouncyCastle.Utilities.IO.Pem
 {
-#if !PORTABLE
     [Serializable]
-#endif
     public class PemGenerationException
 		: Exception
 	{
@@ -13,16 +12,18 @@ namespace Org.BouncyCastle.Utilities.IO.Pem
 		{
 		}
 
-		public PemGenerationException(
-			string message)
+		public PemGenerationException(string message)
 			: base(message)
 		{
 		}
 
-		public PemGenerationException(
-			string		message,
-			Exception	exception)
-			: base(message, exception)
+		public PemGenerationException(string message, Exception innerException)
+			: base(message, innerException)
+		{
+		}
+
+		protected PemGenerationException(SerializationInfo info, StreamingContext context)
+			: base(info, context)
 		{
 		}
 	}