diff --git a/crypto/src/tsp/TSPException.cs b/crypto/src/tsp/TSPException.cs
index 0213490d9..2fe7fdc90 100644
--- a/crypto/src/tsp/TSPException.cs
+++ b/crypto/src/tsp/TSPException.cs
@@ -1,27 +1,29 @@
using System;
+using System.Runtime.Serialization;
namespace Org.BouncyCastle.Tsp
{
-#if !PORTABLE
[Serializable]
-#endif
public class TspException
: Exception
{
public TspException()
+ : base()
{
}
- public TspException(
- string message)
+ public TspException(string message)
: base(message)
{
}
- public TspException(
- string message,
- Exception e)
- : base(message, e)
+ public TspException(string message, Exception innerException)
+ : base(message, innerException)
+ {
+ }
+
+ protected TspException(SerializationInfo info, StreamingContext context)
+ : base(info, context)
{
}
}
diff --git a/crypto/src/tsp/TSPValidationException.cs b/crypto/src/tsp/TSPValidationException.cs
index 066a398e4..eb5181f2e 100644
--- a/crypto/src/tsp/TSPValidationException.cs
+++ b/crypto/src/tsp/TSPValidationException.cs
@@ -1,4 +1,5 @@
using System;
+using System.Runtime.Serialization;
namespace Org.BouncyCastle.Tsp
{
@@ -8,34 +9,30 @@ namespace Org.BouncyCastle.Tsp
* If a failure code is associated with the exception it can be retrieved using
* the getFailureCode() method.</p>
*/
-#if !PORTABLE
[Serializable]
-#endif
public class TspValidationException
: TspException
{
private int failureCode;
- public TspValidationException(
- string message)
+ public TspValidationException(string message)
: base(message)
{
this.failureCode = -1;
}
- public TspValidationException(
- string message,
- int failureCode)
+ public TspValidationException(string message, int failureCode)
: base(message)
{
this.failureCode = failureCode;
}
- /**
- * Return the failure code associated with this exception - if one is set.
- *
- * @return the failure code if set, -1 otherwise.
- */
+ protected TspValidationException(SerializationInfo info, StreamingContext context)
+ : base(info, context)
+ {
+ }
+
+ /// <returns>The failure code associated with this exception, if one is set.</returns>
public int FailureCode
{
get { return failureCode; }
|