There are two ways
- MakeCertificate
- Powershell
MakeCertificate
- Open command prompt
- Go to makecert.exe directory cd C:\Program Files (x86)\Windows Kits\8.1\bin\x64(check the path were your makecert.exe file is present)
- Make your certificate
makecert.exe
-r -pe -n "CN=*.contoso.com" -b 01/01/2010 -e 01/01/2050 -eku
1.3.6.1.5.5.7.3.1 -ss my -sr localMachine -sky exchange -sp "Microsoft RSA
SChannel Cryptographic Provider" -sy 12
(change
the name contoso with your domain name. To check the domain name open Server
Manager→ Local Server→ Domain)
Power Shell
- From windows server 2012 R2 makecert was depreciated and we have to use power shell
- Step:1 Download the ps1 file in the link https://gallery.technet.microsoft.com/scriptcenter/Self-signed-certificate-5920a7c6#content
- Step:2 Copy the download file and extract it into another folder C:\Test\
- Step:3 Open the power shell as administrator mode and then
PS C:\Test> . .\New-SelfSignedCertificateEx
PS C:\Test> New-SelfSignedCertificateEx -Subject
"CN=*.minsa.org" -EKU "Server Authentication" -KeyUsage
0xa0 -StoreLocation "LocalMachine"
-ProviderName "Microsoft Strong Cryptographic Provider"
-Exportable
Please refer below url
http://sanganakauthority.blogspot.in/2014/06/the-certificates-with-cng-private-key.html