-
Notifications
You must be signed in to change notification settings - Fork 86
签名密钥对
yushijinhun edited this page Aug 22, 2020
·
8 revisions
本文主要介绍用于数字签名的密钥对。文中将使用 OpenSSL 对密钥进行操作。
验证服务器会对以下请求的响应中的角色属性进行数字签名:
验证服务器通过API 元数据将公钥公开,以便 authlib-injector 获取。
注意:验证服务器应避免密钥的变化。如果使用多个服务端实例进行负载均衡,那么它们应该使用同一个密钥。
下面对 OpenSSL 的调用都是使用标准输入和标准输出进行输入输出的。
如果要使用文件,可使用参数 -in <file> 和 -out <file>。
密钥算法为 RSA,推荐长度为 4096 位。
openssl genrsa 4096
生成的私钥将输出到标准输出。
openssl rsa -pubout
私钥从标准输入读入,公钥将输出到标准输出。

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.