Advertisement
Guest User

Untitled

a guest
Aug 8th, 2016
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.41 KB | None | 0 0
  1. X509Certificate2 certificate = new X509Certificate2(Settings.Default.PublicKey);
  2.  
  3.             try
  4.             {
  5.                 byte[] encryptedData;
  6.  
  7.                 using (var rsa = (RSACryptoServiceProvider)certificate.PublicKey.Key)
  8.                 {
  9.                     encryptedData = rsa.Encrypt(aes.Key, false);
  10.                 }
  11.                 return Convert.ToBase64String(encryptedData);
  12.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement