为SGEN提供私钥

时间:2010-12-30 23:21:26

标签: digital-certificate sign sgen

我的.NET程序集使用comodo的数字证书签名。我使用SGEN生成序列化程序集。 SGEN需要密钥文件才能为签名源生成此类程序集。我尝试了以下几行:

sgen.exe  /force /parsableerrors /compiler:/keyfile:"mycert.pfx" "myproduct.exe"

但这说我

SGEN: error SGEN1: Unable to generate a temporary class (result=1).
error CS1548: Cryptographic failure while signing assembly' -- 'Key file 'mycert.pfx'
- Bad Version of provider.

我试图使用SN -p mycert.pfx mycert.snk然后

获得肯定可用于SGEN的.snk
sgen.exe  /force /parsableerrors /compiler:/keyfile:"mykey.snk" "myproduct.exe" 

但这说我

SGEN: error SGEN1: Unable to generate a temporary class (result=1).
error CS1548: Cryptographic failure while signing assembly' -- 
'Key file 'mykey.snk' is missing the private key needed for signing'

我读到over the internet这是SGEN错误,它无法使用pfx对程序集进行签名。那我该怎么办?我可以从pfx中提取私钥到snk文件吗?

0 个答案:

没有答案