1

I want to create subject certificate name which contains "," like the image Example

but always fails because "," is used to separated the contain of -n parameter like “CA=CARoot,O=My Organization,OU=Dev,C=Denmark”

Anyone know how to add "," into certificate name? Much appreciate for your helping

quan lai
  • 35
  • 5
  • 1
    How are you creating your certificate in the first place? – bartonjs Mar 01 '17 at 15:43
  • I used this command to create cert: MakeCert.exe -r -pe -n "OU=(c) 2006 thawte Inc. - For authorized use only" -sv "c:\PlaneteersLtd_certificate\XIAMEN_IPRT_TECHNOLOGYLtd1.pvk" -len 2048 "c:\PlaneteersLtd_certificate\XIAMEN_IPRT_TECHNOLOGYLtd1.cer" but can not add "," into OU="..." – quan lai Mar 01 '17 at 16:03

2 Answers2

0

In a Windows Command Prompt you can use a triple-double-quote to make a literal double quote in a quoted argument (from https://stackoverflow.com/a/15262019/6535399).

The X500 name parser uses commas as separators unless it's in a quoted string. So you need the -n value to be interpreted as OU="Hey, there", ....

So, you can do something like

> makecert.exe (etc) -n "OU="""Hey, there""", O=Hmm, CN="""Hello, Nurse!""""

or, to make the what-looks-like-a-quadruple-quote go away:

> makecert.exe (etc) -n "OU="""Hey, there""", O=Hmm, CN="""Hello, Nurse!""", C=US"
Community
  • 1
  • 1
bartonjs
  • 30,352
  • 2
  • 71
  • 111
  • I tried your solution but It did not work, my command: MakeCert.exe -r -pe -n "OU=(c) 2006 thawte Inc."""Hey, there""" - For authorized use only" -sv "c:\PlaneteersLtd_certificate\XIAMEN_IPRT_TECHNOLOGYLtd1.pvk" -len 2048 "c:\PlaneteersLtd_certificate\XIAMEN_IPRT_TECHNOLOGYLtd1.cer" . When I remove """Hey, there""", it create the cert file successfully – quan lai Mar 01 '17 at 17:31
  • The double quote needs to go immediately after the =, and be terminated before the separator-comma. – bartonjs Mar 01 '17 at 17:34
0

I tried your solution but It did not work, my command:

MakeCert.exe -r -pe -n "OU=(c) 2006 thawte Inc."""Hey, there""" - For authorized use only" -sv "c:\PlaneteersLtd_certificate\XIAMEN_IPRT_TECHNOLOGYLtd1.pvk‌​" -len 2048 "c:\PlaneteersLtd_certificate\XIAMEN_IPRT_TECHNOLOGYLtd1.cer‌​"

When I remove """Hey, there""", it create the cert file successfully Example

quan lai
  • 35
  • 5