How can I convert the private key stored in HSM to SignedXml.SigningKey in C#

前端 未结 2 1242
礼貌的吻别
礼貌的吻别 2021-01-06 23:12

I\'m trying to implement some demo of XML signing with a certificate which stored in the HSM.

I found some interesting example from this link: Sign XML Document with

2条回答
  •  庸人自扰
    2021-01-07 00:00

    You need to implement custom class inherited from System.Security.Cryptography.RSA class, use Pkcs11Interop in its implementation and then use instance of your custom class as a SigningKey.

    You can implement it yourself or you can use Pkcs11Interop.X509Store library which provides easy to use PKCS#11 based X.509 certificate store and contains Pkcs11RsaProvider class inherited from System.Security.Cryptography.RSA class. There's also a code sample available which demonstrates its usage with SignedXml class.

提交回复
热议问题