예제 #1
0
        public string Decrypt(string value)
        {
            string result = null;

            try
            {
                result = _cryptography.Decrypt(value);
            }
            catch (Exception)
            {
                //Swallow encrytion errors.
                //TODO: Logging here.
            }

            return(result);
        }
예제 #2
0
        public async Task <UserDTO> Login(string email, string password)
        {
            var user = await _userRepository.FindLogin(email, password);

            user.ChangePassword(_rijndaelCryptography.Decrypt(user.Password));

            return(_mapper.Map <UserDTO>(user));
        }
 public IActionResult Decrypt([FromBody] string text)
 {
     try
     {
         return(Ok(_rijndaelCryptography.Decrypt(text)));
     }
     catch (Exception e)
     {
         return(StatusCode(500, new { message = e.Message }));
     }
 }
예제 #4
0
 public string Decrypt(string text)
 {
     try
     {
         return(_rijndaelCryptography.Decrypt(text));
     }
     catch (Exception ex)
     {
         throw; //Create a CryptographyException
     }
 }