summary refs log tree commit diff
path: root/crypto/src/asn1/cmp/CertifiedKeyPair.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2023-07-21 00:26:34 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2023-07-21 00:26:34 +0700
commit9f36987f992075b2f61214f6d83433efd597e93e (patch)
tree4cc2e19d8dc1229479acbcdf2bb62811b0344785 /crypto/src/asn1/cmp/CertifiedKeyPair.cs
parentRefactoring in Asn1.Cms (diff)
downloadBouncyCastle.NET-ed25519-9f36987f992075b2f61214f6d83433efd597e93e.tar.xz
Refactoring in Asn1.Cmp
Diffstat (limited to 'crypto/src/asn1/cmp/CertifiedKeyPair.cs')
-rw-r--r--crypto/src/asn1/cmp/CertifiedKeyPair.cs5
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/src/asn1/cmp/CertifiedKeyPair.cs b/crypto/src/asn1/cmp/CertifiedKeyPair.cs
index 73828fda4..9c7fd8175 100644
--- a/crypto/src/asn1/cmp/CertifiedKeyPair.cs
+++ b/crypto/src/asn1/cmp/CertifiedKeyPair.cs
@@ -18,7 +18,7 @@ namespace Org.BouncyCastle.Asn1.Cmp
 
         public static CertifiedKeyPair GetInstance(Asn1TaggedObject taggedObject, bool declaredExplicit)
         {
-            return GetInstance(Asn1Sequence.GetInstance(taggedObject, declaredExplicit));
+            return new CertifiedKeyPair(Asn1Sequence.GetInstance(taggedObject, declaredExplicit));
         }
 
         private readonly CertOrEncCert m_certOrEncCert;
@@ -94,7 +94,8 @@ namespace Org.BouncyCastle.Asn1.Cmp
 		 */
 		public override Asn1Object ToAsn1Object()
 		{
-			Asn1EncodableVector v = new Asn1EncodableVector(m_certOrEncCert);
+			Asn1EncodableVector v = new Asn1EncodableVector(3);
+			v.Add(m_certOrEncCert);
             v.AddOptionalTagged(true, 0, m_privateKey);
             v.AddOptionalTagged(true, 1, m_publicationInfo);
 			return new DerSequence(v);