1 files changed, 5 insertions, 10 deletions
diff --git a/crypto/src/asn1/DERExternal.cs b/crypto/src/asn1/DERExternal.cs
index a342d6520..c29975193 100644
--- a/crypto/src/asn1/DERExternal.cs
+++ b/crypto/src/asn1/DERExternal.cs
@@ -34,25 +34,20 @@ namespace Org.BouncyCastle.Asn1
offset++;
enc = GetObjFromVector(vector, offset);
}
- if (!(enc is DerTaggedObject))
+ if (!(enc is Asn1TaggedObject))
{
- dataValueDescriptor = (Asn1Object) enc;
+ dataValueDescriptor = enc;
offset++;
enc = GetObjFromVector(vector, offset);
}
- if (!(enc is DerTaggedObject))
- {
- throw new InvalidOperationException(
- "No tagged object found in vector. Structure doesn't seem to be of type External");
- }
- if (vector.Count != offset + 1)
+ if (vector.Count != offset + 1)
throw new ArgumentException("input vector too large", "vector");
- if (!(enc is DerTaggedObject))
+ if (!(enc is Asn1TaggedObject))
throw new ArgumentException("No tagged object found in vector. Structure doesn't seem to be of type External", "vector");
- DerTaggedObject obj = (DerTaggedObject)enc;
+ Asn1TaggedObject obj = (Asn1TaggedObject)enc;
// Use property accessor to include check on value
Encoding = obj.TagNo;
|