예제 #1
0
        private static void CertificateStatus(string[] serials = null)
        {
            if (serials == null || serials.Length == 0)
            {
                Console.WriteLine("Checking status of issued certificates ...");
                var myEncryptionCert = CertStore.GetCertificate(CertStore.Certificiates.ClientIssuedEncryption);
                var mySigningCert    = CertStore.GetCertificate(CertStore.Certificiates.ClientIssuedSigning);
                serials = new string[] { HexToDec(myEncryptionCert.SerialNumber), HexToDec(mySigningCert.SerialNumber) };
            }
            else
            {
                Console.WriteLine("Checking status of provided serials certificates ...");
            }

            var res = PKIClient.CertificateStatus(serials, KeyGeneratorTypeType.software);

            if (!CheckForError(res))
            {
                exitProgram(Int32.Parse(res.Error.ReturnCode));
                return;
            }

            foreach (var certStatus in res.Response.CertificateStatusResponse.CertificateStatus)
            {
                PrintCertInfo(certStatus);
            }
        }
예제 #2
0
        private static void CertificateStatus(PKIClient client, X509Certificate2 queryCert)
        {
            var res = client.CertificateStatus(new[] { HexToDec(queryCert.SerialNumber) }, KeyGeneratorTypeType.software);

            if (!CheckForError(res))
            {
                return;
            }

            foreach (var x in res.Response.CertificateStatusResponse.CertificateStatus)
            {
                Console.WriteLine(" - " + x.CertificateType);
                Console.WriteLine(" - " + x.Status.Item);
            }
        }