我必须对 Springboot REST 端点实施 https://datatracker.ietf.org/doc/html/draft-cavage-http-signatures-10

I have to implement https://datatracker.ietf.org/doc/html/draft-cavage-http-signatures-10 to Springboot REST endpoints

我是密码学新手,我想对我的 spring-boot 应用程序实施 https://datatracker.ietf.org/doc/html/draft-cavage-http-signatures-10(客户要求)。客户要求我实现一个 header 类似这样的东西,

     Authorization: Signature keyId="Test",algorithm="rsa-sha256",
   signature="SjWJWbWN7i0wzBvtPl8rbASWz5xQW6mcJmn+ibttBqtifLN7Sazz
   6m79cNfwwb8DMJ5cou1s7uEGKKCs+FLEEaDV5lp7q25WqS+lavg7T8hc0GppauB
   6hbgEKTwblDHYGEtbGmtdHgVCk9SuS13F0hZ8FD0k/5OxEPXe5WozsbM="

我不知道基于此规范的身份验证签名生成。 任何人都可以帮助我以简单的方式理解这些术语

  1. KeyId 及其用途是什么?
  2. 什么是签名值以及如何生成它?

我不知道帮我理解这个

您在这里看到的是另一层保护,以防有人破坏 TLS。文档是这样描述的:

For high security transactions, having an additional signature on the HTTP header allows a client to ensure that even if the transport channel has been compromised, that the content of the messages have not been compromised.

所以你真正想做的是使用某种消息验证代码 (MAC) 所以即使主动攻击者有能力操纵发送的消息,MAC 也会不匹配,整个消息将被服务器拒绝。

我查看了文档,实现这些东西不是一件小事。但看起来已经存在可以帮助您实现这一目标的库。第一 Google 次点击:

关于 keyId:

The keyId field is an opaque string that the server can use to look up the component they need to validate the signature. It could be an SSH key fingerprint, a URL to machine-readable key data, an LDAP DN, etc. Management of keys and assignment of keyId is out of scope for this document.

简而言之 - 你决定它会是什么。它需要能够让您识别主题并能够首先验证签名。