我使用.net framework 4.5和.net System.Security.Cryptography库来解密一个大的.p7m文件,文件大小约为70mb . .p7m文件已经转换为字节数组,我想使用EnvelopedCms类来解码.p7m字节数组 . 但是,执行envelopedCms.Decode(p7mByteArray)需要很长的执行时间(大约3xx秒)

byte[] p7mByteArray = File.ReadAllBytes(ATTACHMENT_PATH);
EnvelopedCms envelopedCms = new EnvelopedCms();
envelopedCms.Decode(p7mByteArray);
  • 如果是一个大字节数组,如何提高envelopedCms.Decode()的性能?

  • envelopedCms.Decode()是否支持.net framework 4.5中的字节数组上的流式传输?

  • 以更快的性能速度解码包络字节数组的任何其他替代解决方案?

谢谢 .