Create a self-signed CA certificate with makecert.exe

I am trying to create a self-signed CA certificate on 32-bit Windows 7 (virtual). Makecert v7.1 is located in C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin> .

Whenever I try to execute this command (promoted) ...

 makecert.exe -r -n "CN=MyCert CA" -pe -sv MyCert.pvk -a sha1 -len 2048 -b 09/04/2012 -e 09/04/2018 -cy authority MyCert.cer 

... I get a password request, but when I confirm it, I get:

Error: CryptCertStrToNameW failed => 0x80092023 (-2146885597) Failed

Any help would be appreciated.

Sincerely.

+4
source share
3 answers

I copied your command to the command line and got the same error. However, I retyped the team and it worked. I suspect that one of the characters in the name argument "CN=MyCert CA" is a special character, possibly copied from a word processor.

+13
source

This is an old question, but it looks like you're using word processor "smart quotes" rather than double ASCII quotes.

So the problem is not with makecert , but with the way you entered this command. The Windows command shell, cmd.exe , does not see "CN=MyCert CA" as a quoted word. Instead, he sees two simple words: "CN=MyCert and CA" , with “smart quotes” being part of the word.

  • The double ASCII quotation mark " has a code point of U + 0022 (aka '\ x22' in C # or C).
  • The left double “smart” quote “, " has a code point of U + 201C (aka '\ u201C' in C #).
  • The correct double smart quote has a code point of U + 201D (aka '\ u201D' in C #).

And therefore a mistake.

+11
source

You may also get the same error if you do not have CN = in the name.

For example, I had this error with -n "My Name" , but she succeeded with -n "CN=My Name"

+1
source

Source: https://habr.com/ru/post/1432271/


All Articles