How to make X.509 certificate?

无人久伴 提交于 2019-12-04 16:47:50

I always use the SelfCert tool from PluralSight. You can download it here. The same pages also give usage and code examples.

Great free tool, can't do without it.

It is nice that you have find that makecert command but perhaps if you would also check makecert documentation you have found where the certificate is stored because it is defined in the paramaters of your command:

  • sr says that certificate will be generated for LocalMachine store location
  • ss says that certificate will be stored in Personal (My) store

The certificate is stored in certificate store so use MMC.exe to find it:

  • Open Start menu
  • In Search / Run type mmc and run it
  • In File menu select Add / Remove snap-in
  • Select Certificates snap-in with scope of Local computer and confirm selection

Now in Personal store for your LocalMachine select certificate called MyServerCert and from context menu select All Tasks > Export. During Exporting check that you want export private key but don't check extended security or private key deletion. You will also have to select path where exported certificate will be stored and password for access to a private key.

From VS command prompt you can also run this command which will do the export for you as well:

certutil.exe -privatekey -p password -exportpfx "MyServerCert" C:\Temp\MyServerCert.pfx 

It should export your certificate with private key to Temp directory and password to certificate will be password.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!