/// <summary> /// /// </summary> /// <param name="value"></param> /// <param name="privateKey"></param> /// <returns></returns> public static string DecodeRSA(this string value, string privateKey = privateKeyRSA) { return(RSACrypto.DecryptString(System.Net.WebUtility.UrlDecode(value), privateKey)); }
/// <summary> /// /// </summary> /// <param name="value"></param> /// <param name="publicKey"></param> /// <returns></returns> public static string EncodeRSA(this object value, string publicKey = publicKeyRSA) { return(System.Net.WebUtility.UrlEncode(RSACrypto.EncryptString(value.ToString(), publicKey))); }