I'm trying to figure out how to use the MCSAPI to do AES encryption with the ncipher cryptographic service provider (CSP). What puzzles me is that the AesCryptoServiceProvider
constructor does not accept a CspParameters
class, used to specify nCipher as the csp.
CspParameters cp = new CspParameters(24, "nCipher Enhanced RSA and AES Cryptographic Provider");
RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(CspParameters) // works fine
AesCryptoServiceProvider aes = new AesCryptoServiceProvider(); // Constructor takes no parameters.
From what I can see The Rijndael classes also don't have a way to specify other third party CSP's. What am I missing? Is there a way to initialize my whole system to load a CSP for all subsequent cryptographic calls? Am I suppose to be using the CSP to just manage the symmetric key and then use the default AesCryptoServiceProvider
to encrypt/decrypt? RSACryptoServiceProvider(CspParameters)
works just fine. But I'm wanting to do symmetric encryption.
I'm needing to do this in C# .NET framework.