问题
I am supposed to write a client application in C# that communicates with Thales WebSentry and I need a few hints at how to start.
Device comes with Java SDK but I need to do my programming in .NET. Are there any libraries in .NET that I can use, or will I have to do it all low-level (directly to socket). Any hints or pointers on how and where to start?
Thanks!
回答1:
If the module is PKCS#11-compliant, there should be a .dll somewhere in the development kit that implements the PKCS#11 API. A Google search seems to indicate that it is called wspkcs11d.dll
.
You should be able to P/Invoke to the PKCS#11 library. If Thales have not supplies documentation for the library, you can find the documentation here (but note that they most probably only support a subset of the full standard).
回答2:
There is a CAPI provider for PKCS#11, it's called csp11 though it does not support private objects ( you cant login to tokens ).
The easiest way will be to p-invoke into the pkcs11 library from c#, Call C_GetFunctionList to get pointers to the other functions the library exposes. then call C_Initialize, you can use this with the other new PKCS#11 stuff from thales-ncipher too,
来源:https://stackoverflow.com/questions/812894/how-to-interface-with-pkcs-11-compliant-hsm-device-in-net