Пример #1
0
        public T Decrypt <T>(string base64PriKey) where T : class
        {
            try
            {
                var decryptedMessage = CryptoRSAHelper.RsaDecrypt(Message, base64PriKey);

                return(JsonConvert.DeserializeObject <T>(decryptedMessage));
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
Пример #2
0
        public T Decrypt <T>(string base64PriKey) where T : class
        {
            try
            {
                byte[] key = Convert.FromBase64String(CryptoRSAHelper.RsaDecrypt(Token, base64PriKey));

                byte[] iv = Convert.FromBase64String(IV);

                var decryptedParameters = RijndaelHelper.AesDecrypt(Message, key, iv);

                return(Newtonsoft.Json.JsonConvert.DeserializeObject <T>(decryptedParameters));
            }
            catch (Exception ex)
            {
                return(null);
            }
        }