Esempio n. 1
0
 public byte[] DecryptData(byte[] data)
 {
     using (RSACryptoServiceProvider rsaCryptoServiceProvider = RSAContainerFactory.CreateFromContainer(_containerName))
     {
         return(rsaCryptoServiceProvider.Decrypt(data, RSAEncryptionPadding.Pkcs1));
     }
 }
Esempio n. 2
0
 public byte[] SignData(byte[] data)
 {
     using (RSACryptoServiceProvider rsaCryptoServiceProvider = RSAContainerFactory.CreateFromContainer(_containerName))
     {
         return(rsaCryptoServiceProvider.SignData(data, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1));
     }
 }
Esempio n. 3
0
 public string ExportKey(bool includePrivate)
 {
     using (RSACryptoServiceProvider rsaCryptoServiceProvider = RSAContainerFactory.CreateFromContainer(_containerName))
     {
         return(rsaCryptoServiceProvider.ToXmlString(includePrivate));
     }
 }