void m_decode(Byte[] rawData)
        {
            Asn1Reader asn = new Asn1Reader(rawData);

            if (asn.Tag != 48)
            {
                throw new Asn1InvalidTagException(asn.Offset);
            }
            asn.MoveNext();
            IncludedComponents = AuthorityKeyIdentifierFlags.None;
            do
            {
                switch (asn.Tag)
                {
                case 0x80:
                    KeyIdentifier       = AsnFormatter.BinaryToString(asn.GetPayload(), EncodingType.HexRaw, EncodingFormat.NOCRLF);
                    IncludedComponents |= AuthorityKeyIdentifierFlags.KeyIdentifier;
                    break;

                case 0xa1:
                    IssuerNames = new X509AlternativeNameCollection();
                    var bytes = Asn1Utils.Encode(asn.GetPayload(), 48);
                    IssuerNames.Decode(bytes);
                    IssuerNames.Close();
                    IncludedComponents |= AuthorityKeyIdentifierFlags.AlternativeNames;
                    break;

                case 0x82:
                    SerialNumber        = AsnFormatter.BinaryToString(asn.GetPayload());
                    IncludedComponents |= AuthorityKeyIdentifierFlags.SerialNumber;
                    break;
                }
            } while (asn.MoveNextCurrentLevel());
        }
        void m_decode(Byte[] rawData)
        {
            CrossCertDistributionPoints = new X509AlternativeNameCollection();

            Asn1Reader asn = new Asn1Reader(rawData);

            if (asn.Tag != 48)
            {
                throw new ArgumentException("The data is invalid");
            }
            asn.MoveNext();
            if (asn.Tag == (Byte)Asn1Type.INTEGER)
            {
                DeltaSyncTimeInSeconds = (Int32)Asn1Utils.DecodeInteger(asn.GetTagRawData());
                asn.MoveNext();
            }
            asn.MoveNext();
            do
            {
                var altNames = new X509AlternativeNameCollection();
                altNames.Decode(asn.GetTagRawData());
                CrossCertDistributionPoints.AddRange(altNames);
            } while (asn.MoveNextCurrentLevel());
            CrossCertDistributionPoints.Close();
        }
        static X509AlternativeNameCollection decodeNamesFromAsn(Byte[] rawData)
        {
            X509AlternativeNameCollection altNames = new X509AlternativeNameCollection();
            Asn1Reader asn = new Asn1Reader(rawData);

            asn.MoveNext();
            do
            {
                altNames.Add(new X509AlternativeName(asn.GetPayload()));
            } while (asn.MoveNextCurrentLevel());
            altNames.Close();
            return(altNames);
        }
        static X509AlternativeNameCollection encodeAltNames(X509AlternativeNameCollection permittedSubtree, List <Byte> rawData, Byte tag)
        {
            X509AlternativeNameCollection altNames = new X509AlternativeNameCollection();
            List <Byte> tempRawData = new List <Byte>();

            foreach (X509AlternativeName name in permittedSubtree
                     .Where(x => x.Type != X509AlternativeNamesEnum.RegisteredId))
            {
                altNames.Add(name);
                tempRawData.AddRange(Asn1Utils.Encode(name.RawData, 48));
            }
            rawData.AddRange(Asn1Utils.Encode(tempRawData.ToArray(), tag));
            altNames.Close();
            return(altNames);
        }
        void m_initialize(IEnumerable <String> urls, Int32?syncDeltaTime, Boolean critical)
        {
            Oid      = _oid;
            Critical = critical;
            DeltaSyncTimeInSeconds = syncDeltaTime;

            List <Byte> rawData = new List <Byte>();

            if (DeltaSyncTimeInSeconds != null)
            {
                rawData.AddRange(new Asn1Integer(DeltaSyncTimeInSeconds.Value).RawData);
            }
            Uri[] uris = urls.Select(url => new Uri(url)).ToArray();
            CrossCertDistributionPoints = new X509AlternativeNameCollection();
            foreach (Uri url in uris)
            {
                CrossCertDistributionPoints.Add(new X509AlternativeName(X509AlternativeNamesEnum.URL, url));
            }
            CrossCertDistributionPoints.Close();
            rawData.AddRange(Asn1Utils.Encode(CrossCertDistributionPoints.Encode(), 48));
            RawData = rawData.ToArray();
        }