summary refs log tree commit diff
path: root/crypto/src/security
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/security')
-rw-r--r--crypto/src/security/GeneralSecurityException.cs17
-rw-r--r--crypto/src/security/InvalidKeyException.cs28
-rw-r--r--crypto/src/security/InvalidParameterException.cs28
-rw-r--r--crypto/src/security/KeyException.cs28
-rw-r--r--crypto/src/security/PrivateKeyFactory.cs4
-rw-r--r--crypto/src/security/PublicKeyFactory.cs4
-rw-r--r--crypto/src/security/SecurityUtilityException.cs42
-rw-r--r--crypto/src/security/SignatureException.cs28
-rw-r--r--crypto/src/security/cert/CertificateEncodingException.cs28
-rw-r--r--crypto/src/security/cert/CertificateException.cs28
-rw-r--r--crypto/src/security/cert/CertificateExpiredException.cs28
-rw-r--r--crypto/src/security/cert/CertificateNotYetValidException.cs28
-rw-r--r--crypto/src/security/cert/CertificateParsingException.cs28
-rw-r--r--crypto/src/security/cert/CrlException.cs28
14 files changed, 251 insertions, 96 deletions
diff --git a/crypto/src/security/GeneralSecurityException.cs b/crypto/src/security/GeneralSecurityException.cs
index c1131f04b..02b1f6c57 100644
--- a/crypto/src/security/GeneralSecurityException.cs
+++ b/crypto/src/security/GeneralSecurityException.cs
@@ -1,10 +1,9 @@
 using System;
+using System.Runtime.Serialization;
 
 namespace Org.BouncyCastle.Security
 {
-#if !PORTABLE
     [Serializable]
-#endif
     public class GeneralSecurityException
 		: Exception
 	{
@@ -13,16 +12,18 @@ namespace Org.BouncyCastle.Security
 		{
 		}
 
-		public GeneralSecurityException(
-			string message)
+		public GeneralSecurityException(string message)
 			: base(message)
 		{
 		}
 
-		public GeneralSecurityException(
-			string		message,
-			Exception	exception)
-			: base(message, exception)
+		public GeneralSecurityException(string message, Exception innerException)
+			: base(message, innerException)
+		{
+		}
+
+		protected GeneralSecurityException(SerializationInfo info, StreamingContext context)
+			: base(info, context)
 		{
 		}
 	}
diff --git a/crypto/src/security/InvalidKeyException.cs b/crypto/src/security/InvalidKeyException.cs
index e9cfa75fd..73a59fbb8 100644
--- a/crypto/src/security/InvalidKeyException.cs
+++ b/crypto/src/security/InvalidKeyException.cs
@@ -1,14 +1,30 @@
 using System;
+using System.Runtime.Serialization;
 
 namespace Org.BouncyCastle.Security
 {
-#if !PORTABLE
     [Serializable]
-#endif
-    public class InvalidKeyException : KeyException
+    public class InvalidKeyException
+		: KeyException
 	{
-		public InvalidKeyException() : base() { }
-		public InvalidKeyException(string message) : base(message) { }
-		public InvalidKeyException(string message, Exception exception) : base(message, exception) { }
+		public InvalidKeyException()
+			: base()
+		{
+		}
+
+		public InvalidKeyException(string message)
+			: base(message)
+		{
+		}
+
+		public InvalidKeyException(string message, Exception innerException)
+			: base(message, innerException)
+		{
+		}
+
+		protected InvalidKeyException(SerializationInfo info, StreamingContext context)
+			: base(info, context)
+		{
+		}
 	}
 }
diff --git a/crypto/src/security/InvalidParameterException.cs b/crypto/src/security/InvalidParameterException.cs
index 27b2ea411..fb27a3688 100644
--- a/crypto/src/security/InvalidParameterException.cs
+++ b/crypto/src/security/InvalidParameterException.cs
@@ -1,14 +1,30 @@
 using System;
+using System.Runtime.Serialization;
 
 namespace Org.BouncyCastle.Security
 {
-#if !PORTABLE
     [Serializable]
-#endif
-    public class InvalidParameterException : KeyException
+    public class InvalidParameterException
+		: KeyException
 	{
-		public InvalidParameterException() : base() { }
-		public InvalidParameterException(string message) : base(message) { }
-		public InvalidParameterException(string message, Exception exception) : base(message, exception) { }
+		public InvalidParameterException()
+			: base()
+		{
+		}
+
+		public InvalidParameterException(string message)
+			: base(message)
+		{
+		}
+
+		public InvalidParameterException(string message, Exception innerException)
+			: base(message, innerException)
+		{
+		}
+
+		protected InvalidParameterException(SerializationInfo info, StreamingContext context)
+			: base(info, context)
+		{
+		}
 	}
 }
diff --git a/crypto/src/security/KeyException.cs b/crypto/src/security/KeyException.cs
index 57ce6862b..1ad1b0c49 100644
--- a/crypto/src/security/KeyException.cs
+++ b/crypto/src/security/KeyException.cs
@@ -1,14 +1,30 @@
 using System;
+using System.Runtime.Serialization;
 
 namespace Org.BouncyCastle.Security
 {
-#if !PORTABLE
     [Serializable]
-#endif
-    public class KeyException : GeneralSecurityException
+    public class KeyException
+		: GeneralSecurityException
 	{
-		public KeyException() : base() { }
-		public KeyException(string message) : base(message) { }
-		public KeyException(string message, Exception exception) : base(message, exception) { }
+		public KeyException()
+			: base()
+		{
+		}
+
+		public KeyException(string message)
+			: base(message)
+		{
+		}
+
+		public KeyException(string message, Exception innerException)
+			: base(message, innerException)
+		{
+		}
+
+		protected KeyException(SerializationInfo info, StreamingContext context)
+			: base(info, context)
+		{
+		}
 	}
 }
diff --git a/crypto/src/security/PrivateKeyFactory.cs b/crypto/src/security/PrivateKeyFactory.cs
index a8c4d94d0..93f8a2260 100644
--- a/crypto/src/security/PrivateKeyFactory.cs
+++ b/crypto/src/security/PrivateKeyFactory.cs
@@ -135,7 +135,7 @@ namespace Org.BouncyCastle.Security
                 Gost3410PublicKeyAlgParameters gostParams = Gost3410PublicKeyAlgParameters.GetInstance(
                     algID.Parameters.ToAsn1Object());
 
-                X9ECParameters ecP = ECGost3410NamedCurves.GetByOidX9(gostParams.PublicKeyParamSet);
+                X9ECParameters ecP = ECGost3410NamedCurves.GetByOid(gostParams.PublicKeyParamSet);
 
                 if (ecP == null)
                     throw new ArgumentException("Unrecognized curve OID for GostR3410x2001 private key");
@@ -198,7 +198,7 @@ namespace Org.BouncyCastle.Security
                 if (p is Asn1Sequence && (Asn1Sequence.GetInstance(p).Count == 2 || Asn1Sequence.GetInstance(p).Count == 3))
                 {
 
-                    X9ECParameters ecP = ECGost3410NamedCurves.GetByOidX9(gostParams.PublicKeyParamSet);
+                    X9ECParameters ecP = ECGost3410NamedCurves.GetByOid(gostParams.PublicKeyParamSet);
 
                     ecSpec = new ECGost3410Parameters(
                         new ECNamedDomainParameters(
diff --git a/crypto/src/security/PublicKeyFactory.cs b/crypto/src/security/PublicKeyFactory.cs
index 10b2aacdc..65baf003c 100644
--- a/crypto/src/security/PublicKeyFactory.cs
+++ b/crypto/src/security/PublicKeyFactory.cs
@@ -162,7 +162,7 @@ namespace Org.BouncyCastle.Security
                 Gost3410PublicKeyAlgParameters gostParams = Gost3410PublicKeyAlgParameters.GetInstance(algID.Parameters);
                 DerObjectIdentifier publicKeyParamSet = gostParams.PublicKeyParamSet;
 
-                X9ECParameters ecP = ECGost3410NamedCurves.GetByOidX9(publicKeyParamSet);
+                X9ECParameters ecP = ECGost3410NamedCurves.GetByOid(publicKeyParamSet);
                 if (ecP == null)
                     return null;
 
@@ -238,7 +238,7 @@ namespace Org.BouncyCastle.Security
                 DerObjectIdentifier publicKeyParamSet = gostParams.PublicKeyParamSet;
 
                 ECGost3410Parameters ecDomainParameters =new ECGost3410Parameters(
-                    new ECNamedDomainParameters(publicKeyParamSet, ECGost3410NamedCurves.GetByOidX9(publicKeyParamSet)),
+                    new ECNamedDomainParameters(publicKeyParamSet, ECGost3410NamedCurves.GetByOid(publicKeyParamSet)),
                     publicKeyParamSet,
                     gostParams.DigestParamSet,
                     gostParams.EncryptionParamSet);
diff --git a/crypto/src/security/SecurityUtilityException.cs b/crypto/src/security/SecurityUtilityException.cs
index d3f97c1a3..f10a7fbc5 100644
--- a/crypto/src/security/SecurityUtilityException.cs
+++ b/crypto/src/security/SecurityUtilityException.cs
@@ -1,36 +1,30 @@
 using System;
+using System.Runtime.Serialization;
 
 namespace Org.BouncyCastle.Security
 {
-#if !PORTABLE
     [Serializable]
-#endif
     public class SecurityUtilityException
 		: Exception
     {
-        /**
-        * base constructor.
-        */
-        public SecurityUtilityException()
-        {
-        }
+		public SecurityUtilityException()
+			: base()
+		{
+		}
 
-		/**
-         * create a SecurityUtilityException with the given message.
-         *
-         * @param message the message to be carried with the exception.
-         */
-        public SecurityUtilityException(
-            string message)
+		public SecurityUtilityException(string message)
 			: base(message)
-        {
-        }
+		{
+		}
 
-		public SecurityUtilityException(
-            string		message,
-            Exception	exception)
-			: base(message, exception)
-        {
-        }
-    }
+		public SecurityUtilityException(string message, Exception innerException)
+			: base(message, innerException)
+		{
+		}
+
+		protected SecurityUtilityException(SerializationInfo info, StreamingContext context)
+			: base(info, context)
+		{
+		}
+	}
 }
diff --git a/crypto/src/security/SignatureException.cs b/crypto/src/security/SignatureException.cs
index deaa23432..4bddc3d51 100644
--- a/crypto/src/security/SignatureException.cs
+++ b/crypto/src/security/SignatureException.cs
@@ -1,14 +1,30 @@
 using System;
+using System.Runtime.Serialization;
 
 namespace Org.BouncyCastle.Security
 {
-#if !PORTABLE
     [Serializable]
-#endif
-    public class SignatureException : GeneralSecurityException
+    public class SignatureException
+		: GeneralSecurityException
 	{
-		public SignatureException() : base() { }
-		public SignatureException(string message) : base(message) { }
-		public SignatureException(string message, Exception exception) : base(message, exception) { }
+		public SignatureException()
+			: base()
+		{
+		}
+
+		public SignatureException(string message)
+			: base(message)
+		{
+		}
+
+		public SignatureException(string message, Exception innerException)
+			: base(message, innerException)
+		{
+		}
+
+		protected SignatureException(SerializationInfo info, StreamingContext context)
+			: base(info, context)
+		{
+		}
 	}
 }
diff --git a/crypto/src/security/cert/CertificateEncodingException.cs b/crypto/src/security/cert/CertificateEncodingException.cs
index 20c965630..5c902dfd1 100644
--- a/crypto/src/security/cert/CertificateEncodingException.cs
+++ b/crypto/src/security/cert/CertificateEncodingException.cs
@@ -1,14 +1,30 @@
 using System;
+using System.Runtime.Serialization;
 
 namespace Org.BouncyCastle.Security.Certificates
 {
-#if !PORTABLE
     [Serializable]
-#endif
-    public class CertificateEncodingException : CertificateException
+    public class CertificateEncodingException
+		: CertificateException
 	{
-		public CertificateEncodingException() : base() { }
-		public CertificateEncodingException(string msg) : base(msg) { }
-		public CertificateEncodingException(string msg, Exception e) : base(msg, e) { }
+		public CertificateEncodingException()
+			: base()
+		{
+		}
+
+		public CertificateEncodingException(string message)
+			: base(message)
+		{
+		}
+
+		public CertificateEncodingException(string message, Exception innerException)
+			: base(message, innerException)
+		{
+		}
+
+		protected CertificateEncodingException(SerializationInfo info, StreamingContext context)
+			: base(info, context)
+		{
+		}
 	}
 }
diff --git a/crypto/src/security/cert/CertificateException.cs b/crypto/src/security/cert/CertificateException.cs
index c8819b710..5214675ab 100644
--- a/crypto/src/security/cert/CertificateException.cs
+++ b/crypto/src/security/cert/CertificateException.cs
@@ -1,14 +1,30 @@
 using System;
+using System.Runtime.Serialization;
 
 namespace Org.BouncyCastle.Security.Certificates
 {
-#if !PORTABLE
     [Serializable]
-#endif
-    public class CertificateException : GeneralSecurityException
+    public class CertificateException
+		: GeneralSecurityException
 	{
-		public CertificateException() : base() { }
-		public CertificateException(string message) : base(message) { }
-		public CertificateException(string message, Exception exception) : base(message, exception) { }
+		public CertificateException()
+			: base()
+		{
+		}
+
+		public CertificateException(string message)
+			: base(message)
+		{
+		}
+
+		public CertificateException(string message, Exception innerException)
+			: base(message, innerException)
+		{
+		}
+
+		protected CertificateException(SerializationInfo info, StreamingContext context)
+			: base(info, context)
+		{
+		}
 	}
 }
diff --git a/crypto/src/security/cert/CertificateExpiredException.cs b/crypto/src/security/cert/CertificateExpiredException.cs
index 1d12ba7e9..25cb054bf 100644
--- a/crypto/src/security/cert/CertificateExpiredException.cs
+++ b/crypto/src/security/cert/CertificateExpiredException.cs
@@ -1,14 +1,30 @@
 using System;
+using System.Runtime.Serialization;
 
 namespace Org.BouncyCastle.Security.Certificates
 {
-#if !PORTABLE
     [Serializable]
-#endif
-    public class CertificateExpiredException : CertificateException
+    public class CertificateExpiredException
+		: CertificateException
 	{
-		public CertificateExpiredException() : base() { }
-		public CertificateExpiredException(string message) : base(message) { }
-		public CertificateExpiredException(string message, Exception exception) : base(message, exception) { }
+		public CertificateExpiredException()
+			: base()
+		{
+		}
+
+		public CertificateExpiredException(string message)
+			: base(message)
+		{
+		}
+
+		public CertificateExpiredException(string message, Exception innerException)
+			: base(message, innerException)
+		{
+		}
+
+		protected CertificateExpiredException(SerializationInfo info, StreamingContext context)
+			: base(info, context)
+		{
+		}
 	}
 }
diff --git a/crypto/src/security/cert/CertificateNotYetValidException.cs b/crypto/src/security/cert/CertificateNotYetValidException.cs
index 8de806673..1ea3d0b97 100644
--- a/crypto/src/security/cert/CertificateNotYetValidException.cs
+++ b/crypto/src/security/cert/CertificateNotYetValidException.cs
@@ -1,14 +1,30 @@
 using System;
+using System.Runtime.Serialization;
 
 namespace Org.BouncyCastle.Security.Certificates
 {
-#if !PORTABLE
     [Serializable]
-#endif
-    public class CertificateNotYetValidException : CertificateException
+    public class CertificateNotYetValidException
+		: CertificateException
 	{
-		public CertificateNotYetValidException() : base() { }
-		public CertificateNotYetValidException(string message) : base(message) { }
-		public CertificateNotYetValidException(string message, Exception exception) : base(message, exception) { }
+		public CertificateNotYetValidException()
+			: base()
+		{
+		}
+
+		public CertificateNotYetValidException(string message)
+			: base(message)
+		{
+		}
+
+		public CertificateNotYetValidException(string message, Exception innerException)
+			: base(message, innerException)
+		{
+		}
+
+		protected CertificateNotYetValidException(SerializationInfo info, StreamingContext context)
+			: base(info, context)
+		{
+		}
 	}
 }
diff --git a/crypto/src/security/cert/CertificateParsingException.cs b/crypto/src/security/cert/CertificateParsingException.cs
index 1e0a3f47a..244f3b614 100644
--- a/crypto/src/security/cert/CertificateParsingException.cs
+++ b/crypto/src/security/cert/CertificateParsingException.cs
@@ -1,14 +1,30 @@
 using System;
+using System.Runtime.Serialization;
 
 namespace Org.BouncyCastle.Security.Certificates
 {
-#if !PORTABLE
     [Serializable]
-#endif
-    public class CertificateParsingException : CertificateException
+    public class CertificateParsingException
+		: CertificateException
 	{
-		public CertificateParsingException() : base() { }
-		public CertificateParsingException(string message) : base(message) { }
-		public CertificateParsingException(string message, Exception exception) : base(message, exception) { }
+		public CertificateParsingException()
+			: base()
+		{
+		}
+
+		public CertificateParsingException(string message)
+			: base(message)
+		{
+		}
+
+		public CertificateParsingException(string message, Exception innerException)
+			: base(message, innerException)
+		{
+		}
+
+		protected CertificateParsingException(SerializationInfo info, StreamingContext context)
+			: base(info, context)
+		{
+		}
 	}
 }
diff --git a/crypto/src/security/cert/CrlException.cs b/crypto/src/security/cert/CrlException.cs
index 4f71bea5f..9475f74de 100644
--- a/crypto/src/security/cert/CrlException.cs
+++ b/crypto/src/security/cert/CrlException.cs
@@ -1,14 +1,30 @@
 using System;
+using System.Runtime.Serialization;
 
 namespace Org.BouncyCastle.Security.Certificates
 {
-#if !PORTABLE
     [Serializable]
-#endif
-    public class CrlException : GeneralSecurityException
+    public class CrlException
+		: GeneralSecurityException
 	{
-		public CrlException() : base() { }
-		public CrlException(string msg) : base(msg) {}
-		public CrlException(string msg, Exception e) : base(msg, e) {}
+		public CrlException()
+			: base()
+		{
+		}
+
+		public CrlException(string message)
+			: base(message)
+		{
+		}
+
+		public CrlException(string message, Exception innerException)
+			: base(message, innerException)
+		{
+		}
+
+		protected CrlException(SerializationInfo info, StreamingContext context)
+			: base(info, context)
+		{
+		}
 	}
 }