コード例 #1
0
        private void AddFileToCollection(string path)
        {
            int    i;
            string key;

            byte[]            raw   = EstEIDUtils.ReadFile(path);
            X509Certificate[] chain = X509Utils.LoadCertificate(raw);

            for (i = 0; i < chain.Length; i++)
            {
                key = X509Utils.GetSubjectFields(chain[i], "CN");
                // better safe than sorry, who knows what the dir content consists of...
                if (!certs.Contains(key))
                {
                    certs.Add(key, new X509CertStoreEntry(path, chain[i]));
                }
            }
        }
コード例 #2
0
ファイル: X509Utils.cs プロジェクト: tixsys/esteid
        static public Org.BouncyCastle.X509.X509Certificate[] LoadCertificate(string path)
        {
            byte[] raw = EstEIDUtils.ReadFile(path);

            return(LoadCertificate(raw));
        }