Пример #1
0
        public static void Insert(this X509ExtensionCollection exts, Int32 index, X509Extension extension)
        {
            if (extension == null)
            {
                throw new ArgumentNullException(nameof(extension));
            }
            if (exts == null)
            {
                return;
            }
            if (index < 0 || index >= exts.Count)
            {
                throw new OverflowException();
            }
            List <X509Extension> e = new List <X509Extension>(exts.Cast <X509Extension>());

            e.Insert(index, extension);
            exts = new X509ExtensionCollection();
            exts.AddRange(e);
        }