Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. using System.IO;
  2. using System.Security.Cryptography.X509Certificates;
  3.  
  4. namespace ConsoleApplication2
  5. {
  6. class Program
  7. {
  8. static void Main(string[] args)
  9. {
  10. var certBytes = File.ReadAllBytes(@"c:cert.p12");
  11. var p12Pwd = "somepassword";
  12.  
  13. for (var i = 0; i < 1000; i++)
  14. {
  15. var cert = new X509Certificate2(certBytes, p12Pwd, X509KeyStorageFlags.MachineKeySet);
  16.  
  17. // this line helped keep filesize from growing
  18. // cert.Reset();
  19. }
  20. }
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement