sdlan/priv/public_key_sha256.sh
2026-04-02 14:26:48 +08:00

5 lines
232 B
Bash

# 提取公钥 -> 转换为 RSA 原始格式 (PKCS#1) -> 转为 DER 二进制 -> 计算哈希
openssl x509 -in cert.pem -pubkey -noout | \
openssl rsa -pubin -RSAPublicKey_out -outform DER | \
openssl dgst -sha256 -binary | \
base64