summary refs log tree commit diff
path: root/crypto/src/asn1
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2015-10-22 11:05:46 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2015-10-22 11:05:46 +0700
commit90f260f459d7f15eeff2fd8dfa8bd5347b027e3b (patch)
tree0cd7818125083859a86b0b6f07dc812973683fd4 /crypto/src/asn1
parentMerge branch 'master' of bcgit@git.bouncycastle.org:bc-csharp.git (diff)
downloadBouncyCastle.NET-ed25519-90f260f459d7f15eeff2fd8dfa8bd5347b027e3b.tar.xz
Fix faulty constructor and refactor
Diffstat (limited to 'crypto/src/asn1')
-rw-r--r--crypto/src/asn1/cmp/RevDetails.cs25
1 files changed, 12 insertions, 13 deletions
diff --git a/crypto/src/asn1/cmp/RevDetails.cs b/crypto/src/asn1/cmp/RevDetails.cs
index 1bd95f1db..6bdf5b2e9 100644
--- a/crypto/src/asn1/cmp/RevDetails.cs
+++ b/crypto/src/asn1/cmp/RevDetails.cs
@@ -11,17 +11,15 @@ namespace Org.BouncyCastle.Asn1.Cmp
 		private readonly CertTemplate certDetails;
 		private readonly X509Extensions crlEntryDetails;
 
-		private RevDetails(Asn1Sequence seq)
+        private RevDetails(Asn1Sequence seq)
 		{
 			certDetails = CertTemplate.GetInstance(seq[0]);
-
-			if  (seq.Count > 1)
-			{
-				crlEntryDetails = X509Extensions.GetInstance(seq[1]);
-			}
+            crlEntryDetails = seq.Count <= 1
+                ?   null
+                :   X509Extensions.GetInstance(seq[1]);
 		}
 
-		public static RevDetails GetInstance(object obj)
+        public static RevDetails GetInstance(object obj)
 		{
 			if (obj is RevDetails)
 				return (RevDetails)obj;
@@ -33,21 +31,22 @@ namespace Org.BouncyCastle.Asn1.Cmp
 		}
 
 		public RevDetails(CertTemplate certDetails)
+            :   this(certDetails, null)
 		{
-			this.certDetails = certDetails;
 		}
-		
-		public RevDetails(CertTemplate certDetails, X509Extensions crlEntryDetails)
+
+        public RevDetails(CertTemplate certDetails, X509Extensions crlEntryDetails)
 		{
-			this.crlEntryDetails = crlEntryDetails;
+            this.certDetails = certDetails;
+            this.crlEntryDetails = crlEntryDetails;
 		}
 
-		public virtual CertTemplate CertDetails
+        public virtual CertTemplate CertDetails
 		{
 			get { return certDetails; }
 		}
 
-		public virtual X509Extensions CrlEntryDetails
+        public virtual X509Extensions CrlEntryDetails
 		{
 			get { return crlEntryDetails; }
 		}