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

Discussion in 'ASP .Net Security' started by Kim H, Aug 14, 2006.

  1. Kim H

    Kim H Guest

    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
    Kim H, Aug 14, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sven-Torben Janus
    Replies:
    3
    Views:
    2,673
    Sven-Torben Janus
    Sep 10, 2004
  2. Gabor
    Replies:
    0
    Views:
    520
    Gabor
    Dec 22, 2004
  3. Mike P
    Replies:
    0
    Views:
    2,300
    Mike P
    Mar 12, 2005
  4. Sven-Torben Janus
    Replies:
    1
    Views:
    242
    Svein Terje Gaup
    Sep 15, 2004
  5. Don Nelson
    Replies:
    1
    Views:
    197
    Chris Tanger
    Feb 3, 2005
Loading...

Share This Page