2014-04-22 70 views
0

如何生成用於Authenticode簽名的原始公鑰/私鑰?我在教程中看到這樣的指揮官:如何爲Authenticode簽名生成密鑰?

pvk2pfx.exe -pvk mykey.pvk -pi <password> -spc mycert.spc -pfx mycert.pfx -po <password> 

但他們沒有說如何獲得私鑰。

回答

0

根據Twitter的回答,「您需要從CA獲得第3類代碼簽名證書。」

1

測試你可以生成一個自簽證書:

REM May change depending of your installed Windows SDK 
cd "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin" 

REM Generate the root certificate 
.\makecert.exe -r -pe -n "CN=Sample.CA" -ss CA -sr CurrentUser -a sha1 -cy authority -sky signature -sv d:\Sample.CA.pvk d:\Sample.CA.cer 

REM Add the Root certificate to the user store 
certutil.exe -user -addstore Root d:\Sample.CA.cer 

REM Create the certificate for code signing 
.\makecert.exe -pe -n "CN=Sample.CodeSigning" -eku "1.3.6.1.5.5.7.3.3,1.3.6.1.4.1.311.10.3.13" -a sha1 -cy end -sky signature -ic d:\Sample.CA.cer -iv d:\Sample.CA.pvk -sv d:\Sample.CodeSigning.pvk d:\Sample.CodeSigning.cer 

REM Convert to certificate to pfx file format 
.\pvk2pfx.exe -pvk d:\Sample.CodeSigning.pvk -spc d:\Sample.CodeSigning.cer -pfx d:\Sample.CodeSigning.pfx