On-Security / on-security

基于Spring Security编写,支持OpenID Connect 1.0、OAuth 2.1协议规范的统一身份认证、联合身份认证、SSO单点登录框架
GNU General Public License v3.0
2 stars 1 forks source link

调整RSA密钥对生成规则,支持通过openssl自定义 #106

Closed hengboy closed 1 year ago

hengboy commented 1 year ago

针对不同安全域固定JWKSource,重启后不影响老的AccessToken访问

hengboy commented 1 year ago

如果需要修改RSA密钥对,可以通过openssl来生成后替换。 步骤如下:

# 进入密钥对存储目录
cd ~/on-security-console/key
# 生成私钥
openssl genrsa -out rsa.pem 2048
# 转换私钥的格式,转成Java支持的pkcs#8
openssl pkcs8 -topk8 -inform PEM -in rsa.pem -outform PEM -nocrypt > rsa_private.pem
# 从私钥提取公钥
openssl rsa -in rsa_private.pem -pubout -outform PEM -out  rsa_public.pem