summary refs log tree commit diff
path: root/crypto/src/asn1/esf/SignerLocation.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/asn1/esf/SignerLocation.cs')
-rw-r--r--crypto/src/asn1/esf/SignerLocation.cs19
1 files changed, 3 insertions, 16 deletions
diff --git a/crypto/src/asn1/esf/SignerLocation.cs b/crypto/src/asn1/esf/SignerLocation.cs
index 16dbcd01f..0095c0e5c 100644
--- a/crypto/src/asn1/esf/SignerLocation.cs
+++ b/crypto/src/asn1/esf/SignerLocation.cs
@@ -150,22 +150,9 @@ namespace Org.BouncyCastle.Asn1.Esf
 		public override Asn1Object ToAsn1Object()
 		{
 			Asn1EncodableVector v = new Asn1EncodableVector();
-
-			if (countryName != null)
-			{
-				v.Add(new DerTaggedObject(true, 0, countryName));
-			}
-
-			if (localityName != null)
-			{
-				v.Add(new DerTaggedObject(true, 1, localityName));
-			}
-
-			if (postalAddress != null)
-			{
-				v.Add(new DerTaggedObject(true, 2, postalAddress));
-			}
-
+            v.AddOptionalTagged(true, 0, countryName);
+            v.AddOptionalTagged(true, 1, localityName);
+            v.AddOptionalTagged(true, 2, postalAddress);
 			return new DerSequence(v);
 		}
 	}