コード例 #1
0
 /// <summary>
 /// Decrypts a string (previously encrypted with the Encrypt method)
 /// </summary>
 /// <param name="base64String">The encrypted string</param>
 /// <param name="privateKey">The private key used to decrypt the string</param>
 /// <returns>A string containing the decrypted value</returns>
 public string Decrypt(string base64String, RSAParameters privateKey)
 {
     return(RSAMethods.Decrypt(base64String, privateKey, _keySize));
 }
コード例 #2
0
 /// <summary>
 /// Encrypts a string
 /// </summary>
 /// <param name="byteData">The data to encrypt</param>
 /// <param name="publicKey">The public key used to encrypt the data</param>
 /// <returns>A string containing the encrypted data</returns>
 public string Encrypt(byte[] byteData, RSAParameters publicKey)
 {
     return(RSAMethods.Encrypt(byteData, publicKey, _keySize));
 }