Search code examples
certificatex509certificatemakecert

How to allow commas in makecert.exe when creating a certificate?


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?


Solution

  • 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