Is there any reason that calling SignedCMS.Decode would take 15 seconds or more? I have the following code:
SignedCms signedCms = new SignedCms();
signedCms.Decode(postedData);
where postedData is a byte array of a signed CMS message. Sometimes the function call returns instantly, but most of the time, it takes 10-15 seconds to return causing the message sender to timeout.
This seems to happen whether or not the debugger is attached to the process.
So I narrowed it down to an instantiation of Oid in one of the functions that the Decode function calls. The source is available at Reference Source .NET Framework 4.5.1.
I tested using:
System.Security.Cryptography.Oid oid = new System.Security.Cryptography.Oid("1.2.840.113549.1.7.1");
I also found this link with a similar problem.
Interestingly, disconnecting my wireless adapter, the Oid instantiation occurs immediately, which leads me to believe that it may be network/DNS related (I have not idea what the Oid instantiation is doing). After reconnecting my adapter SignedCms.Decode is working as normal. Another option I read is to remove my computer from the domain and then rejoin. Haven't tried it yet.
Maybe this will help anyone else that is have the same (or similar) problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With