WCF: HSM Modules and Signing of WCF Messages
I had recently have to implement a solution where RSA keys used to sign WCF messages where stored externally (not in Windows Certificate Store).
Keys stored externally were not supposed to be extracted or exportable by any means from the security database where they were stored. The module storing RSA keys has also the ability to sign or encrypt messages, so one could not get a private key out of it (this kind of modules are also known as HSM).
The solution I’ve came out with uses a custom RSAPKCS1SignatureFormatter to do the actual signing of the message.
Download the code from here.
Enjoy!