summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Hook <dgh@bouncycastle.org>2015-10-22 16:07:16 +1100
committerDavid Hook <dgh@bouncycastle.org>2015-10-22 16:07:16 +1100
commit431af0fc14e7eb8682f111e51d859bdc05fbcb01 (patch)
tree1c920ae26dcce077eb5da1ba2d4fd8706a04442c
parentChanged name of Value() to Collect() (diff)
parentFix faulty constructor and refactor (diff)
downloadBouncyCastle.NET-ed25519-431af0fc14e7eb8682f111e51d859bdc05fbcb01.tar.xz
Merge branch 'master' of bcgit@git.bouncycastle.org:bc-csharp.git
-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; }
 		}