Пример #1
0
        private CertificateList(
            Asn1Sequence seq)
        {
            if (seq.Count != 3)
            {
                throw new ArgumentException("sequence wrong size for CertificateList", "seq");
            }

            tbsCertList = TbsCertificateList.GetInstance(seq[0]);
            sigAlgID    = AlgorithmIdentifier.GetInstance(seq[1]);
            sig         = DerBitString.GetInstance(seq[2]);
        }
Пример #2
0
        public static TbsCertificateList GetInstance(
            object obj)
        {
            TbsCertificateList list = obj as TbsCertificateList;

            if (obj == null || list != null)
            {
                return(list);
            }

            if (obj is Asn1Sequence)
            {
                return(new TbsCertificateList((Asn1Sequence)obj));
            }

            throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj");
        }