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