Documentation
¶
Overview ¶
Package sign 实现 Ed25519 服务端签名与规范字节串构造。
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanonicalBytes ¶
CanonicalBytes 构造确定性规范字节串:
0x01 || id || 0x00 || sha256(content) || 0x00 || sha256(logs) || 0x00 || be32(len(os_info)) || os_info || be32(len(machine_code)) || machine_code || be32(len(product_id)) || product_id || be32(len(binary_hash)) || binary_hash || 0x00 || be64(created_at_unix_sec)
首字节 0x01 为格式版本标记,后续增加字段时递增。 带长度前缀的字符串字段内容可能含 0x00,裸串不可解析,故统一加 be32 长度前缀。
Types ¶
type Data ¶
type Data struct {
ID string // feedback UUID
Content string
Logs []byte
OSInfo string
MachineCode string
ProductID string // 产品 ID
BinaryHash string // 可执行文件 sha256 hex(可能为空)
CreatedAt int64 // unix 秒
}
Data 参与签名的记录字段。
Click to show internal directories.
Click to hide internal directories.