PDA

View Full Version : Crypto Service Providers


mark
10-20-2003, 07:04 AM
Anyone here tried using the crypto sevice providers from the System.Security.Cryptography namespace? I'm trying to encrypt some data and send it to my Web Service using the RSACryptoServiceProvider class.
Creating an instance of this class generates the following exception:

System.Security.Cryptography.CryptographicExceptio n: CryptoAPI cryptographic service provider (CSP) for this implementation could not be acquired.
at System.Security.Cryptography.RSACryptoServiceProvi der..ctor(Int32 dwKeySize, CspParameters parameters, Boolean useDefaultKeySize)
at System.Security.Cryptography.RSACryptoServiceProvi der..ctor()

The problem seems to be with the asymetric providers (RSA, DSA). Symetric providers (DES, etc.) appear to work.
I can instantiate and use any of these classes on my local IIS server just fine.

Thanks

bruce
10-22-2003, 08:00 AM
To resolve the problem, you will need to specify the keystore in the code (KeyContainerName)

See
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=%23Keg1Q4TCHA.436%40tkmsftngp10&rnum=6&prev=/groups%3Fq%3DCryptoAPI%2Bcryptographic%2Bservice%2 Bprovider%2B(CSP)%2Bfor%2Bthis%2Bimplementation%2B could%2Bnot%2Bbe%2Bacquired%26hl%3Den%26lr%3D%26ie %3DUTF-8%26oe%3DUTF-8%26selm%3D%2523Keg1Q4TCHA.436%2540tkmsftngp10%26r num%3D6


quote:Originally posted by mark

Anyone here tried using the crypto sevice providers from the System.Security.Cryptography namespace? I'm trying to encrypt some data and send it to my Web Service using the [b]RSACryptoServiceProvider class.
Creating an instance of this class generates the following exception:

System.Security.Cryptography.CryptographicExceptio n: CryptoAPI cryptographic service provider (CSP) for this implementation could not be acquired.
at System.Security.Cryptography.RSACryptoServiceProvi der..ctor(Int32 dwKeySize, CspParameters parameters, Boolean useDefaultKeySize)
at System.Security.Cryptography.RSACryptoServiceProvi der..ctor()

The problem seems to be with the asymetric providers (RSA, DSA). Symetric providers (DES, etc.) appear to work.
I can instantiate and use any of these classes on my local IIS server just fine.

Thanks
</blockquote id="quote"></font id="quote">