Beispiel #1
0
        static int RunIntermediateOptions(IcaOptions io)
        {
            using (CertificateRootAuthority rootAuthority = new CertificateRootAuthority(io.InPfxFile, io.InPfxPassword))
            {
                X509Certificate2 cert     = rootAuthority.GenerateAndSignIntermediateCertificate(io.SubjectName);
                byte[]           pfxBytes = cert.Export(X509ContentType.Pfx, io.PfxPassword);
                File.WriteAllBytes(io.PfxFile + ".pfx", pfxBytes);


                if (false == io.NoPem)
                {
                    File.WriteAllText(io.PfxFile + ".pem", cert.ToPem());
                }
            }

            return(0);
        }