示例#1
0
        public void IssueCrl(string id, bool copyOnline = true)
        {
            Console.Write($"Issuing CRL for certificate {id}...");

            var context = new IssueCrlContext(id, this);

            GenerateCrl(context);
            ConvertCrl(context, copyOnline);

            Console.WriteLine(" done.");
        }
示例#2
0
        private void GenerateCrl(IssueCrlContext context)
        {
            var arguments = new List <string>
            {
                "ca",
                "-gencrl",
                "-out", context.IssuerCrlPemFilePath,
                "-config", context.ConfigFilePath,
            };

            Execute(context, arguments.ToArray());
        }
示例#3
0
        private void ConvertCrl(IssueCrlContext context, bool copyOnline)
        {
            var arguments = new List <string>
            {
                "crl",
                "-in", context.IssuerCrlPemFilePath,
                "-inform", "pem",
                "-out", context.IssuerCrlFilePath,
                "-outform", "der",
            };

            Execute(context, arguments.ToArray());

            if (copyOnline)
            {
                File.Copy(
                    context.IssuerCrlFilePath,
                    Path.Combine(OnlineDirectoryPath, Path.GetFileName(context.IssuerCrlFilePath)));
            }
        }