我面临一个问题,我无法使用内置工具将证书私钥导入 monos 证书存储/密钥对存储certmgr
。
将证书公共版本添加到商店可以正常使用
user@maschine:~certs$ certmgr -add -c My MyCert.crt
Mono Certificate Manager - version 2.10.8.1
Manage X.509 certificates and CRL from stores.
Copyright 2002, 2003 Motus Technologies. Copyright 2004-2008 Novell. BSD licensed.
1 certificate(s) added to store My.
但是尝试添加相应的私钥以异常结束
user@maschine:~certs$ certmgr -add -c My MyCert.p12
Mono Certificate Manager - version 2.10.8.1
Manage X.509 certificates and CRL from stores.
Copyright 2002, 2003 Motus Technologies. Copyright 2004-2008 Novell. BSD licensed.
Unhandled Exception: System.Security.Cryptography.CryptographicException: Invalid MAC - file may have been tampered!
尝试先添加公共版本 ( .cer
),然后从私有版本 ( ) 导入相应的私钥.p12
失败,但有一个稍微不同的例外:
user@maschine:~certs$ certmgr -add -c My MyCert.crt
Mono Certificate Manager - version 2.10.8.1
Manage X.509 certificates and CRL from stores.
Copyright 2002, 2003 Motus Technologies. Copyright 2004-2008 Novell. BSD licensed.
1 certificate(s) added to store My.
user@maschine:~certs$ certmgr -importKey -c My MyCert.p12
Mono Certificate Manager - version 2.10.8.1
Manage X.509 certificates and CRL from stores.
Copyright 2002, 2003 Motus Technologies. Copyright 2004-2008 Novell. BSD licensed.
Unhandled Exception: System.Security.Cryptography.CryptographicException: Improperly protected user's key pairs in '/var/licapp/.config/.mono/keypairs'.
使用密码保护证书(并将相应的参数添加到命令中)也无济于事。
我在 Debian Wheezy 上使用 mono V 2.10.8.1。有人知道如何在商店中添加句柄证书并使用 certmgr 处理他们的密钥对吗?
我正在考虑一种解决方法,我只将 p12 文件保留在我的应用程序下而不使用存储,我猜这将是一个更不干净的解决方案。但我无法将证书和密钥对都添加到商店。
顺便说一句,证书似乎还可以。将它们添加到 Windows 下的应用商店就可以了。