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
(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