跳到主要内容

3.3.7. JSON Web Signature (JWS) Algorithms (JSON Web Signature (JWS) 算法)

3.3.7. JSON Web Signature (JWS) Algorithms (JSON Web Signature (JWS) 算法)

若签名算法为 [RFC7518] 建立的 "JSON Web Signature and Encryption Algorithms" 注册表中的 JSON Object Signing and Encryption (JOSE) 签名算法, 则 JWS 算法定义决定对签名与验证应用的签名与哈希算法.

对签名与验证二者, HTTP 消息的签名基 (第 2.5 节) 用作完整的 "JWS Signing Input". 不使用 JOSE Header [JWS] [RFC7517], 且在应用算法之前不对签名基先进行 Base64 编码. JWS Signature 的输出在 JOSE 使用的 Base64url 编码之前作为字节数组取得.

JWS 算法不得为 "none", 且不得为 JOSE Implementation Requirement 为 "Prohibited" 的任何算法.

来自 "JSON Web Signature and Encryption Algorithms" 注册表的 JSON Web Algorithm (JWA) 值不包含为签名参数. 通常可使用 JSON Web Keys (JWK) 或 JOSE 实现中常见的其他机制声明 JWS 算法. 事实上, JWA 值未在 "HTTP Signature Algorithms" 注册表 (第 6.2 节) 中注册, 因此使用 JOSE 签名算法时完全不使用显式 alg 签名参数.