summary refs log tree commit diff
path: root/crypto/src/asn1/esf
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2023-02-17 17:58:20 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2023-02-17 17:58:20 +0700
commite3d12a2c33a7a9d0f371e1d5ff07f7ab7a3eb7ae (patch)
treea0a855afdfbfe6a4cc8a5b026f9b815ee7147d4b /crypto/src/asn1/esf
parentRefactoring in Cms (diff)
downloadBouncyCastle.NET-ed25519-e3d12a2c33a7a9d0f371e1d5ff07f7ab7a3eb7ae.tar.xz
Refactoring around Asn1EncodableVector
Diffstat (limited to 'crypto/src/asn1/esf')
-rw-r--r--crypto/src/asn1/esf/CrlOcspRef.cs2
-rw-r--r--crypto/src/asn1/esf/RevocationValues.cs2
-rw-r--r--crypto/src/asn1/esf/SignerAttribute.cs15
3 files changed, 5 insertions, 14 deletions
diff --git a/crypto/src/asn1/esf/CrlOcspRef.cs b/crypto/src/asn1/esf/CrlOcspRef.cs
index 6153e0c53..6f55ff057 100644
--- a/crypto/src/asn1/esf/CrlOcspRef.cs
+++ b/crypto/src/asn1/esf/CrlOcspRef.cs
@@ -90,7 +90,7 @@ namespace Org.BouncyCastle.Asn1.Esf
 
 		public override Asn1Object ToAsn1Object()
 		{
-			Asn1EncodableVector v = new Asn1EncodableVector();
+			Asn1EncodableVector v = new Asn1EncodableVector(3);
 
 			if (crlids != null)
 			{
diff --git a/crypto/src/asn1/esf/RevocationValues.cs b/crypto/src/asn1/esf/RevocationValues.cs
index 61bfd0be1..f3b36f1d1 100644
--- a/crypto/src/asn1/esf/RevocationValues.cs
+++ b/crypto/src/asn1/esf/RevocationValues.cs
@@ -119,7 +119,7 @@ namespace Org.BouncyCastle.Asn1.Esf
 
 		public override Asn1Object ToAsn1Object()
 		{
-			Asn1EncodableVector v = new Asn1EncodableVector();
+			Asn1EncodableVector v = new Asn1EncodableVector(3);
             v.AddOptionalTagged(true, 0, m_crlVals);
             v.AddOptionalTagged(true, 1, m_ocspVals);
 
diff --git a/crypto/src/asn1/esf/SignerAttribute.cs b/crypto/src/asn1/esf/SignerAttribute.cs
index 39bd910b2..f90968cf8 100644
--- a/crypto/src/asn1/esf/SignerAttribute.cs
+++ b/crypto/src/asn1/esf/SignerAttribute.cs
@@ -80,18 +80,9 @@ namespace Org.BouncyCastle.Asn1.Esf
 		*/
 		public override Asn1Object ToAsn1Object()
 		{
-			Asn1EncodableVector v = new Asn1EncodableVector();
-
-			if (claimedAttributes != null)
-			{
-				v.Add(new DerTaggedObject(0, claimedAttributes));
-			}
-			else
-			{
-				v.Add(new DerTaggedObject(1, certifiedAttributes));
-			}
-
-			return new DerSequence(v);
+			return claimedAttributes != null
+				?	new DerSequence(new DerTaggedObject(0, claimedAttributes))
+				:	new DerSequence(new DerTaggedObject(1, certifiedAttributes));
 		}
 	}
 }