CryptoAPI cryptographic service provider (CSP) for this implementation could not be acquired

K

Kim H

I have made a crypto assembly that is used in a ASP .NET application
(framework 1.1).
in this assembly I have the following code:

CspParameters cp = new CspParameters();
cp.KeyContainerName = "myContainer";
cp.Flags = CspProviderFlags.UseMachineKeyStore;
RSA cryptKey = new RSACryptoServiceProvider(cp);

It seems to be running fine, but now we are trying to loadtest the
application.
With pretty heavy load it is running fine for maybe 20-25 minutes, but then
we start seeing these exceptions:

"CryptoAPI cryptographic service provider (CSP) for this implementation
could not be acquired"
StackTrace= at
System.Security.Cryptography.RSACryptoServiceProvider..ctor(Int32 dwKeySize,
CspParameters parameters, Boolean useDefaultKeySize)

I'm pretty clueless why it only appears after some time has past, but it
seems that maybe something is not garbage collected or maybe
RSACryptoServiceProvider is not thread safe?

Does anyone have an idea why this is happening or what could be done to
prevent it?

Thanks,
Kim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top