如果响应被加密 json,应该是什么 Content-Type?

What should be Content-Type if response is encrypted json?

对于在 body 中包含加密 JSON 的 REST Web 服务响应,Content-Type header 应该是什么?

这里加密的JSON不代表JOSE或者JWE。它是由拦截器使用任何算法完成的对称加密。我可以保留 application/json 吗?

根据 RFC1847,您应该使用 multipart/encrypted。然后,您必须在两个必需的正文部分中提供有关加密和未加密数据格式的信息。

来自 RFC 的示例:

Content-Type: multipart/encrypted; protocol="TYPE/STYPE";
        boundary="Encrypted Boundary"

--Encrypted Boundary
Content-Type: TYPE/STYPE

CONTROL INFORMATION for protocol "TYPE/STYPE" would be here

--Encrypted Boundary
Content-Type: application/octet-stream

    Content-Type: application/json