PVK2PFX Error 0x80070490 - Cannot find certificates that match the key

倾然丶 夕夏残阳落幕 提交于 2019-12-05 12:57:28

Turns out that this year we were given a new private key.

Well, you're not given a private key, the certificate+key is fetched through the browser and stored in a certificate store. From there we can export a .PFX (A pfx contains a certificate and a private key).

With this PFX exported from the browser's certificate store, we can use it directly to sign code with signtool.

Note: We were actually gluttons for punishment, and went through steps:

+--[.pfx]---+     +--[.cer]---+     +--[.spc]---+           +--[.pfx]---+
|Certificate|====>|Certificate|====>|Software   |=========> |Certificate|
|    +      |     +-----------+     |Publishing |           |     +     |
|Private Key|==+       +            |Certificate|   +=====> |Private Key|
+-----------+  |                    +-----------+   |       +-----------+
               |                                    | 
               |                                    |
               |  +--[.pem]---+     +--[.pvk]---+   |
               +=>|Private Key| ==> |Private Key|===+
                  +-----------+     +-----------+

But all that route gave us was a private key file (*.pvk) that wasn't protected with a password; so signtool could run without user interaction.

But the answer to this question was: The private key doesn't match the certificate.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!