Some checks failed
Build Multi-Platform Binaries / build-frontend (push) Failing after 13m34s
Build Multi-Platform Binaries / build-binaries (amd64, darwin, server, false) (push) Has been cancelled
Build Multi-Platform Binaries / build-binaries (amd64, linux, client, true) (push) Has been cancelled
Build Multi-Platform Binaries / build-binaries (amd64, linux, server, true) (push) Has been cancelled
Build Multi-Platform Binaries / build-binaries (amd64, windows, client, true) (push) Has been cancelled
Build Multi-Platform Binaries / build-binaries (amd64, windows, server, true) (push) Has been cancelled
Build Multi-Platform Binaries / build-binaries (arm, 7, linux, client, true) (push) Has been cancelled
Build Multi-Platform Binaries / build-binaries (arm, 7, linux, server, true) (push) Has been cancelled
Build Multi-Platform Binaries / build-binaries (arm64, darwin, server, false) (push) Has been cancelled
Build Multi-Platform Binaries / build-binaries (arm64, linux, client, true) (push) Has been cancelled
Build Multi-Platform Binaries / build-binaries (arm64, linux, server, true) (push) Has been cancelled
Build Multi-Platform Binaries / build-binaries (arm64, windows, server, false) (push) Has been cancelled
- 移除远程密钥撤销检查功能 - 移除远程公钥列表拉取和缓存机制 - 将官方公钥改为客户端内置固定值 - 简化 GetPublicKeyByID 接口实现 - 移除相关的安全配置初始化代码 - 将插件仓库URL配置改为可配置化设置
32 lines
787 B
Go
32 lines
787 B
Go
package sign
|
||
|
||
import (
|
||
"crypto/ed25519"
|
||
"sync"
|
||
)
|
||
|
||
// 官方固定公钥(客户端内置)
|
||
const OfficialPublicKeyBase64 = "0A0xRthj0wgPg8X8GJZ6/EnNpAUw5v7O//XLty+P5Yw="
|
||
|
||
var (
|
||
officialPubKey ed25519.PublicKey
|
||
officialPubKeyOnce sync.Once
|
||
officialPubKeyErr error
|
||
)
|
||
|
||
// initOfficialKey 初始化官方公钥
|
||
func initOfficialKey() {
|
||
officialPubKey, officialPubKeyErr = DecodePublicKey(OfficialPublicKeyBase64)
|
||
}
|
||
|
||
// GetOfficialPublicKey 获取官方公钥
|
||
func GetOfficialPublicKey() (ed25519.PublicKey, error) {
|
||
officialPubKeyOnce.Do(initOfficialKey)
|
||
return officialPubKey, officialPubKeyErr
|
||
}
|
||
|
||
// GetPublicKeyByID 根据 ID 获取公钥(兼容旧接口,忽略 keyID)
|
||
func GetPublicKeyByID(keyID string) (ed25519.PublicKey, error) {
|
||
return GetOfficialPublicKey()
|
||
}
|