Click here to Skip to main content
15,946,988 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
hello everybody

i have a cab file and i want to put it in my web page as a OBJECT (contains my activex control)
i have used makecert.exe by this command to generate the MyCert.cer and MyCert_PK.pvk files

makecert -ss MyCertStore MyCert.cer -sv MyCert_PK.pvk

then i have used this command for signing my cab file :

signtool sign /f MyCert.cer  /csp "Microsoft Strong Cryptographic Provider" /kc MyCert_PK.pvk

but execution of that was failed and its message is :

SignTool Error: The specified private key does not match the public key of the
selected certificate.

what else i must done befor these steps for signing my cab file ? or what am i doing wrong in this case ?

1 solution

It looks like you have a few issues in your process. The error message you are getting basically means "your SSL cert is messed up". The first issue I see is in your makecert process. You are missing some switches that are required to make a proper cert file. Beyond this, using a local cert like this should only be for testing, and not for your live application. For your live application, you should be using a real cert from GoDaddy, Thawte, or one of the other providers. In the meantime, however, here is a good resource on making your own cert:[^]

Once you get to the point of using the signtool, I would recommend using the wizard. It is so much better at showing you what you need to do next compared to the command line. Here is a tutorial on how to do that:[^]
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900