summary refs log tree commit diff
path: root/crypto/src/asn1/isismtt/x509/ProcurationSyntax.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2019-06-04 16:55:26 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2019-06-04 16:55:26 +0700
commit3eb93b423abeefbdc03f0ecc38751d76428ba23e (patch)
treef364f857c54f65eb59462560b1f282b896eecf8b /crypto/src/asn1/isismtt/x509/ProcurationSyntax.cs
parentPort LinkedCertificate from bc-java (diff)
downloadBouncyCastle.NET-ed25519-3eb93b423abeefbdc03f0ecc38751d76428ba23e.tar.xz
Refactoring
Diffstat (limited to 'crypto/src/asn1/isismtt/x509/ProcurationSyntax.cs')
-rw-r--r--crypto/src/asn1/isismtt/x509/ProcurationSyntax.cs36
1 files changed, 18 insertions, 18 deletions
diff --git a/crypto/src/asn1/isismtt/x509/ProcurationSyntax.cs b/crypto/src/asn1/isismtt/x509/ProcurationSyntax.cs
index f42364699..60d3a88e8 100644
--- a/crypto/src/asn1/isismtt/x509/ProcurationSyntax.cs
+++ b/crypto/src/asn1/isismtt/x509/ProcurationSyntax.cs
@@ -209,25 +209,25 @@ namespace Org.BouncyCastle.Asn1.IsisMtt.X509
 		*/
 		public override Asn1Object ToAsn1Object()
 		{
-			Asn1EncodableVector vec = new Asn1EncodableVector();
-			if (country != null)
-			{
-				vec.Add(new DerTaggedObject(true, 1, new DerPrintableString(country, true)));
-			}
-			if (typeOfSubstitution != null)
-			{
-				vec.Add(new DerTaggedObject(true, 2, typeOfSubstitution));
-			}
-			if (thirdPerson != null)
-			{
-				vec.Add(new DerTaggedObject(true, 3, thirdPerson));
-			}
-			else
-			{
-				vec.Add(new DerTaggedObject(true, 3, certRef));
-			}
+            Asn1EncodableVector v = new Asn1EncodableVector();
+
+            if (country != null)
+            {
+                v.Add(new DerTaggedObject(true, 1, new DerPrintableString(country, true)));
+            }
+
+            v.AddOptionalTagged(true, 2, typeOfSubstitution);
+
+            if (thirdPerson != null)
+            {
+                v.Add(new DerTaggedObject(true, 3, thirdPerson));
+            }
+            else
+            {
+                v.Add(new DerTaggedObject(true, 3, certRef));
+            }
 
-			return new DerSequence(vec);
+            return new DerSequence(v);
 		}
 	}
 }