FromAsn1Octets() static private method

static private FromAsn1Octets ( byte octets ) : DerBitString
octets byte
return DerBitString
        internal static Asn1Object CreatePrimitiveDerObject(
            int tagNo,
            byte[] bytes)
        {
            switch (tagNo)
            {
            case Asn1Tags.BitString:
                return(DerBitString.FromAsn1Octets(bytes));

            case Asn1Tags.BmpString:
                return(new DerBmpString(bytes));

            case Asn1Tags.Boolean:
                return(new DerBoolean(bytes));

            case Asn1Tags.Enumerated:
                return(new DerEnumerated(bytes));

            case Asn1Tags.GeneralizedTime:
                return(new DerGeneralizedTime(bytes));

            case Asn1Tags.GeneralString:
                return(new DerGeneralString(bytes));

            case Asn1Tags.IA5String:
                return(new DerIA5String(bytes));

            case Asn1Tags.Integer:
                return(new DerInteger(bytes));

            case Asn1Tags.Null:
                return(DerNull.Instance);      // actual content is ignored (enforce 0 length?)

            case Asn1Tags.NumericString:
                return(new DerNumericString(bytes));

            case Asn1Tags.ObjectIdentifier:
                return(new DerObjectIdentifier(bytes));

            case Asn1Tags.OctetString:
                return(new DerOctetString(bytes));

            case Asn1Tags.PrintableString:
                return(new DerPrintableString(bytes));

            case Asn1Tags.T61String:
                return(new DerT61String(bytes));

            case Asn1Tags.UniversalString:
                return(new DerUniversalString(bytes));

            case Asn1Tags.UtcTime:
                return(new DerUtcTime(bytes));

            case Asn1Tags.Utf8String:
                return(new DerUtf8String(bytes));

            case Asn1Tags.VisibleString:
                return(new DerVisibleString(bytes));

            default:
                return(new DerUnknownTag(false, tagNo, bytes));
            }
        }