1

I try to use makecert.exe to create a certificate but it shows like this:

C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin>makecert -ss TESTCOM -n CN="TESTCOM FOR Co.,Ltd." -sv E:\markcab\TEST.pvk -r
E:\markcab\TEST.cer Error:CryptCertStrToNameW failed => 0x80092023 (-2146885597) Failed

I know it caused by the comma contained in CN="TEST Co.,Ltd" , but I must to use the comma in this command, how could I do?

halfer
  • 19,824
  • 17
  • 99
  • 186
Zoe.D
  • 15
  • 4
  • If you are not bound to use makecert.exe then use [xca](https://sourceforge.net/projects/xca/) – pepo Oct 31 '16 at 08:02
  • Thanks a lot, I'll try it at once. – Zoe.D Oct 31 '16 at 08:21
  • Beware that makecert tool is deprecated and not recommended for use anymore: https://msdn.microsoft.com/en-us/library/windows/desktop/aa386968(v=vs.85).aspx – Crypt32 Oct 31 '16 at 11:19

1 Answers1

2

To include a coma, you have to enclose your CN with quote and add '\' before and after the CN value

C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin>makecert -ss TESTCOM -n "CN=\"TESTCOM FOR Co.,Ltd.\"" -sv E:\markcab\TEST.pvk -r
Camille G.
  • 3,058
  • 1
  • 25
  • 41
  • Thank you very much!! It's work for me. I've spent a lot of time on this problem. I had never thought about this way before. Awesome :D – Zoe.D Oct 31 '16 at 13:22