Ejemplo n.º 1
0
        // [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
        public IActionResult Decrypt(string keyName, string keyId, [FromBody] ippw.EncryptedData encryptedData)
        {
            try
            {
                var decryptedData = keyManager.Decrypt(HttpContext.User, keyName, keyId, encryptedData);

                return(Ok(decryptedData));
            }
            catch (CustomerKeyStore.Models.KeyAccessException)
            {
                return(StatusCode(403));
            }
            catch (ArgumentException e)
            {
                return(BadRequest(e));
            }
        }