I'm developing an API server that will take input from user for following information
"CN=ABC123,O=DEF,L=XYZ,S=CA,C=US,E=info@abc.com"
and create a signed developer's certificate using our root certificate. For making certificates using makecert.exe
I've followed Creating self signed certificates with makecert.exe for development tutorial and created root certificate using following commands
makecert.exe ^
-n "CN=CARoot" ^
-r ^
-pe ^
-a sha512 ^
-len 4096 ^
-cy authority ^
-sv CARoot.pvk ^
CARoot.cer
pvk2pfx.exe ^
-pvk CARoot.pvk ^
-spc CARoot.cer ^
-pfx CARoot.pfx ^
-po Test123
in command prompt and it asks for certificate and private.key passwords in a prompt popup that is fine since this is one time process and I have done this manually
Where as for developers certificate I have used
Process.Start("makecert.exe",certCmd);
with the following in certCmd
as string
makecert.exe ^
-n "CN=%1" ^
-iv CARoot.pvk ^
-ic CARoot.cer ^
-pe ^
-a sha512 ^
-len 4096 ^
-b 01/01/2014 ^
-e 01/01/2016 ^
-sky exchange ^
-eku 1.3.6.1.5.5.7.3.2 ^
-sv %1.pvk ^
%1.cer
pvk2pfx.exe ^
-pvk %1.pvk ^
-spc %1.cer ^
-pfx %1.pfx ^
-po Test123
now according to the documentation there is no -po
parameter that is given in the above command and as a result it asks for password in the prompt that is an issue here
since this is an API and there will be no way to input the password in the prompt for private key
The other option is to use X509Certificate2
and bouncyCastle
but not sure how to use them, any help will be appreciable
I want to keep it as simple as possible and that is the reason I went for makecert.exe
with Process.Start()