There is a group of CryptoApi functions which works with crypto service providers (CSP).
CPAcquireContext
CPCreateHash
CPDecrypt
CPDeriveKey
CPDestroyHash
CPDestroyKey
CPDuplicateHash
CPDuplicateKey
CPEncrypt
CPExportKey
CPGenKey
CPGenRandom
CPGetHashParam
CPGetKeyParam
CPGetProvParam
CPGetUserKey
CPHashData
CPHashSessionKey
CPImportKey
CPReleaseContext
CPSetHashParam
CPSetKeyParam
CPSetProvParam
CPSignHash
CPVerifySignature
Yes, I know that there is System.Cryptography namespace. But I don't need their implementations.
Is there any ready library which provides a .NET wrapper to these functions?
There has been an extended article on MSDN about this topic:
Extending .NET Cryptography with CAPICOM and P/Invoke
An article on using CryptoAPI Certificate Stores from .Net.
Some P/Invoke declarations lifted from this blog post that shows the p/Invoke definitions for it:
[snip] code sample too large for SO [/snip]