summary refs log tree commit diff
path: root/crypto/src/asn1/cmp
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/asn1/cmp')
-rw-r--r--crypto/src/asn1/cmp/CertOrEncCert.cs6
-rw-r--r--crypto/src/asn1/cmp/CertifiedKeyPair.cs12
-rw-r--r--crypto/src/asn1/cmp/KeyRecRepContent.cs8
-rw-r--r--crypto/src/asn1/cmp/PKIBody.cs2
4 files changed, 15 insertions, 13 deletions
diff --git a/crypto/src/asn1/cmp/CertOrEncCert.cs b/crypto/src/asn1/cmp/CertOrEncCert.cs
index 1423503d2..d248de1aa 100644
--- a/crypto/src/asn1/cmp/CertOrEncCert.cs
+++ b/crypto/src/asn1/cmp/CertOrEncCert.cs
@@ -13,7 +13,7 @@ namespace Org.BouncyCastle.Asn1.Cmp
 				return null;
             if (obj is CertOrEncCert certOrEncCert)
                 return certOrEncCert;
-            return new CertOrEncCert(Asn1TaggedObject.GetInstance(obj));
+            return new CertOrEncCert(Asn1TaggedObject.GetInstance(obj, Asn1Tags.ContextSpecific));
         }
 
         public static CertOrEncCert GetInstance(Asn1TaggedObject taggedObject, bool declaredExplicit)
@@ -28,11 +28,11 @@ namespace Org.BouncyCastle.Asn1.Cmp
 		{
 			if (taggedObject.TagNo == 0)
 			{
-				m_certificate = CmpCertificate.GetInstance(taggedObject.GetObject());
+				m_certificate = CmpCertificate.GetInstance(taggedObject.GetExplicitBaseObject());
 			}
 			else if (taggedObject.TagNo == 1)
 			{
-                m_encryptedCert = EncryptedKey.GetInstance(taggedObject.GetObject());
+                m_encryptedCert = EncryptedKey.GetInstance(taggedObject.GetExplicitBaseObject());
 			}
 			else
 			{
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());
 				}
 			}
 		}
diff --git a/crypto/src/asn1/cmp/KeyRecRepContent.cs b/crypto/src/asn1/cmp/KeyRecRepContent.cs
index 880eb9895..8121988d2 100644
--- a/crypto/src/asn1/cmp/KeyRecRepContent.cs
+++ b/crypto/src/asn1/cmp/KeyRecRepContent.cs
@@ -30,18 +30,18 @@ namespace Org.BouncyCastle.Asn1.Cmp
 
 			for (int pos = 1; pos < seq.Count; ++pos)
 			{
-				Asn1TaggedObject tObj = Asn1TaggedObject.GetInstance(seq[pos]);
+				Asn1TaggedObject tObj = Asn1TaggedObject.GetInstance(seq[pos], Asn1Tags.ContextSpecific);
 
 				switch (tObj.TagNo)
 				{
 				case 0:
-					m_newSigCert = CmpCertificate.GetInstance(tObj.GetObject());
+					m_newSigCert = CmpCertificate.GetInstance(tObj.GetExplicitBaseObject());
 					break;
 				case 1:
-					m_caCerts = Asn1Sequence.GetInstance(tObj.GetObject());
+					m_caCerts = Asn1Sequence.GetInstance(tObj.GetExplicitBaseObject());
 					break;
 				case 2:
-					m_keyPairHist = Asn1Sequence.GetInstance(tObj.GetObject());
+					m_keyPairHist = Asn1Sequence.GetInstance(tObj.GetExplicitBaseObject());
 					break;
 				default:
 					throw new ArgumentException("unknown tag number: " + tObj.TagNo, "seq");
diff --git a/crypto/src/asn1/cmp/PKIBody.cs b/crypto/src/asn1/cmp/PKIBody.cs
index 2a92053b5..467a78c8d 100644
--- a/crypto/src/asn1/cmp/PKIBody.cs
+++ b/crypto/src/asn1/cmp/PKIBody.cs
@@ -87,7 +87,7 @@ namespace Org.BouncyCastle.Asn1.Cmp
         private PkiBody(Asn1TaggedObject taggedObject)
         {
             m_tagNo = taggedObject.TagNo;
-            m_body = GetBodyForType(m_tagNo, taggedObject.GetObject());
+            m_body = GetBodyForType(m_tagNo, taggedObject.GetExplicitBaseObject());
         }
 
         /**