Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / June 2006

Tip: Looking for answers? Try searching our database.

RSACryptoServiceProvider.VerifyData Hangs

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
PV - 29 Jun 2006 21:46 GMT
I have found that RSACryptoServiceProvider.VerifyData sometimes hangs for
several (typically 6 or more) seconds.  This is very irritating since a
component that I am using makes this call every time a form in my
application opens.  The entire application freezes.  Obviously it makes my
application very sluggish.

Mind you, on some machines the above always seems to be very quick.  And on
others it can be quick for several minutes, and then start hanging for a
while.

I'm using .Net Framework 2.0.  Here is some sample code from my very basic
"hello world" application, followed by the trace output (generated using
Enterprise Library)...

       public static void Trace(string message)
       {
               Logger.Write(message, "Trace", 0, 0,
TraceEventType.Information);
       }

       private RSACryptoServiceProvider encryptionService = new
RSACryptoServiceProvider();
       private string publicKey = [I have an approximately 340 character
xml formatted string here]
       private string xmlData = [I have an approximately 470 character xml
formatted string here]
       private string Signature = [I have an approximately 200 character
base 64 encoded string here]

       private void button1_Click(object sender, EventArgs e)
       {
           Trace("Before encryptionService.FromXmlString");

           encryptionService.FromXmlString(publicKey);
           Trace("After
LicenseProviderBase.EncryptionService.FromXmlString");

           Trace("Before encryptionService.VerifyData");
           bool result =
encryptionService.VerifyData(Encoding.UTF8.GetBytes(this.xmlData),
                  new SHA1Managed(),
Convert.FromBase64String(this.Signature));
           Trace("After encryptionService.VerifyData");
       }

----------------------------------------
Timestamp: 6/29/2006 4:54:07 PM
Message: Before encryptionService.FromXmlString
Category: Trace
Priority: 0
EventId: 0
Severity: Information
Title:
Machine: CHL0130
Application Domain: HelloWorld.exe
Process Id: 3056
Process Name: C:\Program Files\HelloWorld\HelloWorld.exe
Win32 Thread Id: 3876
Thread Name:
Extended Properties:
----------------------------------------
----------------------------------------
Timestamp: 6/29/2006 4:54:08 PM
Message: After LicenseProviderBase.EncryptionService.FromXmlString
Category: Trace
Priority: 0
EventId: 0
Severity: Information
Title:
Machine: CHL0130
Application Domain: HelloWorld.exe
Process Id: 3056
Process Name: C:\Program Files\HelloWorld\HelloWorld.exe
Win32 Thread Id: 3876
Thread Name:
Extended Properties:
----------------------------------------
----------------------------------------
Timestamp: 6/29/2006 4:54:08 PM
Message: Before encryptionService.VerifyData
Category: Trace
Priority: 0
EventId: 0
Severity: Information
Title:
Machine: CHL0130
Application Domain: HelloWorld.exe
Process Id: 3056
Process Name: C:\Program Files\HelloWorld\HelloWorld.exe
Win32 Thread Id: 3876
Thread Name:
Extended Properties:
----------------------------------------
----------------------------------------
Timestamp: 6/29/2006 4:54:14 PM
Message: After encryptionService.VerifyData
Category: Trace
Priority: 0
EventId: 0
Severity: Information
Title:
Machine: CHL0130
Application Domain: HelloWorld.exe
Process Id: 3056
Process Name: C:\Program Files\HelloWorld\HelloWorld.exe
Win32 Thread Id: 3876
Thread Name:
Extended Properties:
----------------------------------------
PV - 29 Jun 2006 22:41 GMT
Oh, another thing worth mentioning:  I have not been able to detect any CPU
spike at the time the application is hanging.

>I have found that RSACryptoServiceProvider.VerifyData sometimes hangs for
>several (typically 6 or more) seconds.  This is very irritating since a
[quoted text clipped - 105 lines]
> Extended Properties:
> ----------------------------------------

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.