Example #1
0
        public static string CreateCARoot2()
        {
            var caRoot = Cert2.CreateCertificateAuthorityCertificate("MyRootCA2");

            byte[] caRootPfx = caRoot.Export(X509ContentType.Pfx, PIN);
            File.WriteAllBytes(CARoot2Pfx, caRootPfx);
            byte[] caRootCer = caRoot.Export(X509ContentType.Cert, PIN);
            File.WriteAllBytes(CARoot2Cer, caRootCer);
            return(CARootPfx);
        }
Example #2
0
        public static string CreateCARoot()
        {
            var caRoot = Cert2.CreateCertificateAuthorityCertificate("MyRootCA");
            var add    = Cert2.AddCertToStore(caRoot, StoreName.Root, StoreLocation.LocalMachine);

            byte[] caRootPfx = caRoot.Export(X509ContentType.Pfx, PIN);
            File.WriteAllBytes(CARootPfx, caRootPfx);
            byte[] caRootCer = caRoot.Export(X509ContentType.Cert, PIN);
            File.WriteAllBytes(CARootCer, caRootCer);
            return(CARootPfx);
        }