summary refs log tree commit diff
path: root/crypto/src/asn1/pkcs/CertificationRequestInfo.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/asn1/pkcs/CertificationRequestInfo.cs')
-rw-r--r--crypto/src/asn1/pkcs/CertificationRequestInfo.cs14
1 files changed, 4 insertions, 10 deletions
diff --git a/crypto/src/asn1/pkcs/CertificationRequestInfo.cs b/crypto/src/asn1/pkcs/CertificationRequestInfo.cs
index 6d980131e..b775014b2 100644
--- a/crypto/src/asn1/pkcs/CertificationRequestInfo.cs
+++ b/crypto/src/asn1/pkcs/CertificationRequestInfo.cs
@@ -104,17 +104,11 @@ namespace Org.BouncyCastle.Asn1.Pkcs
 			get { return attributes; }
 		}
 
-		public override Asn1Object ToAsn1Object()
+        public override Asn1Object ToAsn1Object()
         {
-            Asn1EncodableVector v = new Asn1EncodableVector(
-				version, subject, subjectPKInfo);
-
-			if (attributes != null)
-            {
-                v.Add(new DerTaggedObject(false, 0, attributes));
-            }
-
-			return new DerSequence(v);
+            Asn1EncodableVector v = new Asn1EncodableVector(version, subject, subjectPKInfo);
+            v.AddOptionalTagged(false, 0, attributes);
+            return new DerSequence(v);
         }
 
         private static void ValidateAttributes(Asn1Set attributes)