From b72579c4b1200459f959bcd6a25364e239420573 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Fri, 24 Jun 2022 15:07:29 +0700 Subject: Cleanup Exception classes --- crypto/src/pkcs/PkcsException.cs | 36 +++++++++++++++++++++++------------- crypto/src/pkcs/PkcsIOException.cs | 35 ++++++++++++++++++++++++----------- 2 files changed, 47 insertions(+), 24 deletions(-) (limited to 'crypto/src/pkcs') diff --git a/crypto/src/pkcs/PkcsException.cs b/crypto/src/pkcs/PkcsException.cs index 7a69ff736..ba296882c 100644 --- a/crypto/src/pkcs/PkcsException.cs +++ b/crypto/src/pkcs/PkcsException.cs @@ -1,21 +1,31 @@ using System; +using System.Runtime.Serialization; namespace Org.BouncyCastle.Pkcs { - /// - /// Base exception for PKCS related issues. - /// - public class PkcsException + /// Base exception for PKCS related issues. + [Serializable] + public class PkcsException : Exception { - public PkcsException(string message) - : base(message) - { - } + public PkcsException() + : base() + { + } - public PkcsException(string message, Exception underlying) - : base(message, underlying) - { - } - } + public PkcsException(string message) + : base(message) + { + } + + public PkcsException(string message, Exception innerException) + : base(message, innerException) + { + } + + protected PkcsException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } + } } diff --git a/crypto/src/pkcs/PkcsIOException.cs b/crypto/src/pkcs/PkcsIOException.cs index 889b0fcb0..4523ac286 100644 --- a/crypto/src/pkcs/PkcsIOException.cs +++ b/crypto/src/pkcs/PkcsIOException.cs @@ -1,19 +1,32 @@ using System; using System.IO; +using System.Runtime.Serialization; namespace Org.BouncyCastle.Pkcs { - /// - /// Base exception for parsing related issues in the PKCS namespace. - /// - public class PkcsIOException: IOException + /// Base exception for parsing related issues in the PKCS namespace. + [Serializable] + public class PkcsIOException + : IOException { - public PkcsIOException(string message) : base(message) - { - } + public PkcsIOException() + : base() + { + } - public PkcsIOException(string message, Exception underlying) : base(message, underlying) - { - } - } + public PkcsIOException(string message) + : base(message) + { + } + + public PkcsIOException(string message, Exception innerException) + : base(message, innerException) + { + } + + protected PkcsIOException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } + } } -- cgit 1.4.1