コード例 #1
0
ファイル: AnchorCommands.cs プロジェクト: blinds52/nhind
        public void AnchorEnsure(string[] args)
        {
            string owner = args.GetRequiredValue(0);
            CertificateFileInfo certFileInfo = CertificateFileInfo.Create(1, args);

            PushCerts(owner, certFileInfo.LoadCerts(), true, certFileInfo.Status);
        }
コード例 #2
0
        public void CertificateAdd(string[] args)
        {
            CertificateFileInfo certFileInfo = CertificateFileInfo.Create(0, args);
            MemoryX509Store     certStore    = certFileInfo.LoadCerts();

            PushCerts(certStore, false, certFileInfo.Status);
        }
コード例 #3
0
ファイル: Pkcs11Commands.cs プロジェクト: ywangmaxmd/nhin-d
        public void CertificateExportKey(string[] args)
        {
            CertificateFileInfo certFileInfo = CertificateFileInfo.Create(0, args);
            MemoryX509Store     certStore    = certFileInfo.LoadCerts();

            ShowKey(certStore);
        }
コード例 #4
0
        public void CertificateEnsure(string[] args)
        {
            CertificateFileInfo certFileInfo = CertificateFileInfo.Create(0, args);
            MemoryX509Store     certStore    = certFileInfo.LoadCerts();

            //
            // This checks for duplicates...(using thumbprints)
            //
            PushCerts(certStore, true, certFileInfo.Status);
        }
コード例 #5
0
ファイル: AnchorCommands.cs プロジェクト: blinds52/nhind
        public void AnchorAddEx(string[] args)
        {
            string owner       = args.GetRequiredValue(0);
            bool   forIncoming = args.GetRequiredValue <bool>(1);
            bool   forOutgoing = args.GetRequiredValue <bool>(2);
            bool   checkDupes  = args.GetRequiredValue <bool>(3);
            CertificateFileInfo certFileInfo = CertificateFileInfo.Create(4, args);

            PushCerts(owner, certFileInfo.LoadCerts(), false, certFileInfo.Status, forIncoming, forOutgoing);
        }
コード例 #6
0
        public void CertificateSearchByFile(string[] args)
        {
            CertificateFileInfo certFileInfo = CertificateFileInfo.Create(0, args);
            MemoryX509Store     certs        = certFileInfo.LoadCerts();

            WriteLine(string.Empty);

            this.Search(
                x => (certs.FirstOrDefault(y => this.Match(x, y)) != null)
                );
        }
コード例 #7
0
ファイル: AnchorCommands.cs プロジェクト: blinds52/nhind
        public void AnchorSearchByFile(string[] args)
        {
            string owner = args.GetRequiredValue(0);
            CertificateFileInfo certFileInfo = CertificateFileInfo.Create(1, args);
            MemoryX509Store     certs        = certFileInfo.LoadCerts();

            WriteLine(string.Empty);

            this.Search(
                owner,
                x => (certs.FirstOrDefault(y => this.CertCommands.Match(x, y)) != null)
                );
        }
コード例 #8
0
        public void CertificateEnsureMachine(string[] args)
        {
            using (SystemX509Store store = OpenStore(args.GetRequiredValue(0)))
            {
                CertificateFileInfo certFileInfo = CertificateFileInfo.Create(1, args);
                MemoryX509Store     certs        = certFileInfo.LoadCerts(MachineKeyFlags);
                foreach (X509Certificate2 cert in certs)
                {
                    string comment = "EXISTS";
                    if (!store.Contains(cert))
                    {
                        store.Add(cert);
                        comment = "ADDED";
                    }

                    WriteLine("{0}: {1}, Thumbprint:{2}", comment, cert.Subject, cert.Thumbprint);
                }
            }
        }