Esempio n. 1
0
        private static Asn1Node ReadUniversalNode(Asn1UniversalNodeType type, Asn1TagForm tagForm, Stream stream)
        {
            switch (type)
            {
            case Asn1UniversalNodeType.Boolean: return(Asn1Boolean.ReadFrom(stream));

            case Asn1UniversalNodeType.Integer: return(Asn1Integer.ReadFrom(stream));

            case Asn1UniversalNodeType.BitString: return(Asn1BitString.ReadFrom(stream));

            case Asn1UniversalNodeType.OctetString: return(Asn1OctetString.ReadFrom(stream));

            case Asn1UniversalNodeType.Null: return(Asn1Null.ReadFrom(stream));

            case Asn1UniversalNodeType.ObjectId: return(Asn1ObjectIdentifier.ReadFrom(stream));

            case Asn1UniversalNodeType.Utf8String: return(Asn1Utf8String.ReadFrom(stream));

            case Asn1UniversalNodeType.NumericString: return(Asn1NumericString.ReadFrom(stream));

            case Asn1UniversalNodeType.PrintableString: return(Asn1PrintableString.ReadFrom(stream));

            case Asn1UniversalNodeType.T61String: return(Asn1T61String.ReadFrom(stream));

            case Asn1UniversalNodeType.Ia5String: return(Asn1Ia5String.ReadFrom(stream));

            case Asn1UniversalNodeType.UtcTime: return(Asn1UtcTime.ReadFrom(stream));

            case Asn1UniversalNodeType.Sequence: return(Asn1Sequence.ReadFrom(stream));

            case Asn1UniversalNodeType.Set: return(Asn1Set.ReadFrom(stream));

            default:
                throw new NotSupportedException($"unsupported universal type {type}");
            }
        }
Esempio n. 2
0
 protected bool Equals(Asn1ObjectIdentifier other)
 {
     return(ToString().Equals(other.ToString()));
 }