Documentation
¶
Overview ¶
Package integrity 实现 GM/T 0099 §7.4、附录 D 的清单保护与防夹带检查。
Index ¶
Constants ¶
View Source
const EntryPoint = spec.IntegrityEntryPoint
Variables ¶
View Source
var ( ErrInvalid = errors.New("integrity: 无效的完整性元数据") ErrProtected = errors.New("integrity: 已有完整性保护") )
Functions ¶
This section is empty.
Types ¶
type Manifest ¶
type Manifest struct {
XMLName xml.Name `json:"-"`
ID string `xml:"ID,attr" json:"id"`
CreatorName string `xml:"CreatorName,attr,omitempty" json:"creator_name,omitempty"`
Version string `xml:"Version,attr,omitempty" json:"version,omitempty"`
CreationDate string `xml:"CreationDate,attr,omitempty" json:"creation_date,omitempty"`
Files []File `xml:"FileList>File" json:"files"`
SignedValueLoc string `xml:"SignedValueLoc" json:"signed_value_location,omitempty"`
}
type Options ¶
type Options struct {
Limits crypt.Limits
Verification sign.VerificationOptions
// Decrypt 用于遍历加密映射与逻辑文档,不生成明文 ZIP。
Decrypt *crypt.DecryptOptions
}
Options 的零预算使用 crypt 的有限默认值。不会隐式访问网络。
type ProtectOptions ¶
type ProtectOptions struct {
Options
ID string
CreatorName string
Date time.Time
Sign func(context.Context, []byte) ([]byte, error)
}
ProtectOptions 用外部签名器为最终清单提供带时间戳的 GB/T 35275 签名。
type Report ¶
type Report struct {
Present bool `json:"present"`
Status string `json:"status"`
Manifest *Manifest `json:"manifest,omitempty"`
Checks []sign.VerificationCheck `json:"checks,omitempty"`
Signature *sign.SignatureVerificationResult `json:"signature,omitempty"`
PhysicalSignatures []sign.Verification `json:"physical_signatures,omitempty"`
Unlisted []string `json:"unlisted,omitempty"`
Missing []string `json:"missing,omitempty"`
Unreferenced []string `json:"unreferenced,omitempty"`
Unprotected []string `json:"unprotected,omitempty"`
Diagnostics []string `json:"diagnostics,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.