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