package sign import ( "crypto/ed25519" "encoding/json" "git.wxccs.org/EntitleForge/EntitleForge-SDK-go/crypto" "git.wxccs.org/EntitleForge/EntitleForge-SDK-go/license" ) // rootKid 是 root 签 trust bundle 时 header.kid 的固定值 // (root 唯一,不需要轮换标识;装载方以公钥锚定)。 const rootKid = "root" // SignBundle 把信任链快照(signing 公钥集合 + CRL)打包为 root 签名的 // trust bundle token。快照由 crypto.TrustChain.Bundle 提供,只含公钥数据。 func SignBundle(tc *crypto.TrustChain, rootPriv ed25519.PrivateKey) (string, error) { payload, err := json.Marshal(tc.Bundle()) if err != nil { return "", err } return SignToken(rootPriv, rootKid, license.TypTrust, payload) }