.NET ContentInfo taking too long to process

2019-08-15 08:24发布

问题:

The following code using ContentInfo(System.Security.Cryptography.Pkcs.ContentInfo) is really taking a long time to execute.

Is there anything I can do to speed it up?

byte[] fileContents = File.ReadAllBytes(fileName );
var contentInfo = new ContentInfo(fileContents);
var signedCms = new SignedCms(contentInfo);
signedCms.Decode(fileContents);
signedCms.RemoveSignature(0);

回答1:

In my situation - I figured out the problem, it was only taking too long during a debug session, outside of the VS debugger, the operation performed at normal acceptable speeds.



标签: c# .net security