diff options
-rw-r--r-- | crypto/src/asn1/Asn1InputStream.cs | 8 | ||||
-rw-r--r-- | crypto/src/asn1/Asn1Tags.cs | 12 |
2 files changed, 18 insertions, 2 deletions
diff --git a/crypto/src/asn1/Asn1InputStream.cs b/crypto/src/asn1/Asn1InputStream.cs index 82ff77fda..3454dc0d4 100644 --- a/crypto/src/asn1/Asn1InputStream.cs +++ b/crypto/src/asn1/Asn1InputStream.cs @@ -425,6 +425,14 @@ namespace Org.BouncyCastle.Asn1 return DerVideotexString.CreatePrimitive(bytes); case Asn1Tags.VisibleString: return DerVisibleString.CreatePrimitive(bytes); + case Asn1Tags.Time: + case Asn1Tags.Date: + case Asn1Tags.TimeOfDay: + case Asn1Tags.DateTime: + case Asn1Tags.Duration: + case Asn1Tags.OidIri: + case Asn1Tags.RelativeOidIri: + throw new IOException("unsupported tag " + tagNo + " encountered"); default: throw new IOException("unknown tag " + tagNo + " encountered"); } diff --git a/crypto/src/asn1/Asn1Tags.cs b/crypto/src/asn1/Asn1Tags.cs index f962e4e86..5ae99b45b 100644 --- a/crypto/src/asn1/Asn1Tags.cs +++ b/crypto/src/asn1/Asn1Tags.cs @@ -4,6 +4,7 @@ namespace Org.BouncyCastle.Asn1 { public class Asn1Tags { + // 0x00: Reserved for use by the encoding rules public const int Boolean = 0x01; public const int Integer = 0x02; public const int BitString = 0x03; @@ -17,12 +18,12 @@ namespace Org.BouncyCastle.Asn1 public const int EmbeddedPdv = 0x0b; public const int Utf8String = 0x0c; public const int RelativeOid = 0x0d; - // NOTE: 14-15 are reserved. + public const int Time = 0x0e; + // 0x0f: Reserved for future editions of this Recommendation | International Standard public const int Sequence = 0x10; public const int SequenceOf = 0x10; // for completeness public const int Set = 0x11; public const int SetOf = 0x11; // for completeness - public const int NumericString = 0x12; public const int PrintableString = 0x13; public const int T61String = 0x14; @@ -36,6 +37,13 @@ namespace Org.BouncyCastle.Asn1 public const int UniversalString = 0x1c; public const int UnrestrictedString = 0x1d; public const int BmpString = 0x1e; + public const int Date = 0x1f; + public const int TimeOfDay = 0x20; + public const int DateTime = 0x21; + public const int Duration = 0x22; + public const int OidIri = 0x23; + public const int RelativeOidIri = 0x24; + // 0x25..: Reserved for addenda to this Recommendation | International Standard public const int Constructed = 0x20; |