summary refs log tree commit diff
path: root/crypto/src/asn1/pkcs/Pfx.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/asn1/pkcs/Pfx.cs')
-rw-r--r--crypto/src/asn1/pkcs/Pfx.cs14
1 files changed, 4 insertions, 10 deletions
diff --git a/crypto/src/asn1/pkcs/Pfx.cs b/crypto/src/asn1/pkcs/Pfx.cs
index 9676f64fc..4f958a070 100644
--- a/crypto/src/asn1/pkcs/Pfx.cs
+++ b/crypto/src/asn1/pkcs/Pfx.cs
@@ -49,17 +49,11 @@ namespace Org.BouncyCastle.Asn1.Pkcs
 			get { return macData; }
 		}
 
-		public override Asn1Object ToAsn1Object()
+        public override Asn1Object ToAsn1Object()
         {
-            Asn1EncodableVector v = new Asn1EncodableVector(
-				new DerInteger(3), contentInfo);
-
-			if (macData != null)
-            {
-                v.Add(macData);
-            }
-
-			return new BerSequence(v);
+            Asn1EncodableVector v = new Asn1EncodableVector(new DerInteger(3), contentInfo);
+            v.AddOptional(macData);
+            return new BerSequence(v);
         }
     }
 }