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-18 12:06:03 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2023-07-18 12:06:03 +0700
commit913eada3ad9394f1327a1feb80a3261f7c6e55bb (patch)
tree6366c1e196ad2ac249edf12a4d41d52ee2d28629 /crypto/src/asn1/cmp/CertifiedKeyPair.cs
parentRefactoring around PrivateKeyInfo (diff)
downloadBouncyCastle.NET-ed25519-913eada3ad9394f1327a1feb80a3261f7c6e55bb.tar.xz
Deprecated Asn1TaggedObject.GetObject and refactor
Diffstat (limited to 'crypto/src/asn1/cmp/CertifiedKeyPair.cs')
-rw-r--r--crypto/src/asn1/cmp/CertifiedKeyPair.cs12
1 files changed, 7 insertions, 5 deletions
diff --git a/crypto/src/asn1/cmp/CertifiedKeyPair.cs b/crypto/src/asn1/cmp/CertifiedKeyPair.cs
index e26c5c629..73828fda4 100644
--- a/crypto/src/asn1/cmp/CertifiedKeyPair.cs
+++ b/crypto/src/asn1/cmp/CertifiedKeyPair.cs
@@ -33,20 +33,22 @@ namespace Org.BouncyCastle.Asn1.Cmp
 			{
 				if (seq.Count == 2)
 				{
-					Asn1TaggedObject tagged = Asn1TaggedObject.GetInstance(seq[1]);
+					Asn1TaggedObject tagged = Asn1TaggedObject.GetInstance(seq[1], Asn1Tags.ContextSpecific);
 					if (tagged.TagNo == 0)
 					{
-						m_privateKey = EncryptedKey.GetInstance(tagged.GetObject());
+						m_privateKey = EncryptedKey.GetInstance(tagged.GetExplicitBaseObject());
 					}
 					else
 					{
-						m_publicationInfo = PkiPublicationInfo.GetInstance(tagged.GetObject());
+						m_publicationInfo = PkiPublicationInfo.GetInstance(tagged.GetExplicitBaseObject());
 					}
 				}
 				else
 				{
-                    m_privateKey = EncryptedKey.GetInstance(Asn1TaggedObject.GetInstance(seq[1]).GetObject());
-                    m_publicationInfo = PkiPublicationInfo.GetInstance(Asn1TaggedObject.GetInstance(seq[2]).GetObject());
+                    m_privateKey = EncryptedKey.GetInstance(
+						Asn1TaggedObject.GetInstance(seq[1], Asn1Tags.ContextSpecific).GetExplicitBaseObject());
+                    m_publicationInfo = PkiPublicationInfo.GetInstance(
+						Asn1TaggedObject.GetInstance(seq[2], Asn1Tags.ContextSpecific).GetExplicitBaseObject());
 				}
 			}
 		}