I am facing an issue where I am unable to import a certificates Private-Key into monos certificatestore/keypairstore using the built in tool certmgr
.
Adding a Certificates Public Version to the store works fine using
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.
However trying to add the corresponding Private-Key ends in a Exception
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!
Trying to add the Public Verison (.cer
) first and then importing the corresponding Private-Key from the private version (.p12
) fails to, but with a
slightly different exception:
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'.
Protecting the certificate with a password (and adding the corresponding parameter to the command) doesn't help either.
I am using mono V 2.10.8.1 on Debian Wheezy. Does anybody know how to add handle Certificates in stores and hanlding their keypairs with certmgr too?
I am considering a workaround where i just keep the p12-files beneath my application without using the stores, which would be a much more unclean solution i guess. But I am just unable to add both, the Certificate and the KeyPair to the Store.
The Certificats seem to be ok btw. Adding them to the Store under Windows works just fine.