summary refs log tree commit diff
path: root/crypto/src/asn1/ocsp/SingleResponse.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/asn1/ocsp/SingleResponse.cs')
-rw-r--r--crypto/src/asn1/ocsp/SingleResponse.cs18
1 files changed, 4 insertions, 14 deletions
diff --git a/crypto/src/asn1/ocsp/SingleResponse.cs b/crypto/src/asn1/ocsp/SingleResponse.cs
index 544232abe..ecdf3dab0 100644
--- a/crypto/src/asn1/ocsp/SingleResponse.cs
+++ b/crypto/src/asn1/ocsp/SingleResponse.cs
@@ -118,20 +118,10 @@ namespace Org.BouncyCastle.Asn1.Ocsp
          */
         public override Asn1Object ToAsn1Object()
         {
-            Asn1EncodableVector v = new Asn1EncodableVector(
-				certID, certStatus, thisUpdate);
-
-			if (nextUpdate != null)
-            {
-                v.Add(new DerTaggedObject(true, 0, nextUpdate));
-            }
-
-			if (singleExtensions != null)
-            {
-                v.Add(new DerTaggedObject(true, 1, singleExtensions));
-            }
-
-			return new DerSequence(v);
+            Asn1EncodableVector v = new Asn1EncodableVector(certID, certStatus, thisUpdate);
+            v.AddOptionalTagged(true, 0, nextUpdate);
+            v.AddOptionalTagged(true, 1, singleExtensions);
+            return new DerSequence(v);
         }
     }
 }