feat(加密解密): 完善加密管理与保存继承
build.yaml / build (push) Successful in 45s

This commit is contained in:
xiaoqidun committed 2026-09-30 01:35:24 +08:00
1 parent d56a84f92a
commit b0b194895a
8 files changed
+263 -109

No files matched your search

+11 -6
View File
@@ -62,6 +62,7 @@ type Session struct {
signatureError error
signaturesRead bool
editing bool
editor *ofdgo.Editor
}
// pageBoxInfo 按页索引缓存真实区域,valid区分未读取与零值区域
@@ -251,10 +252,11 @@ type SignatureStampInfo struct {
// EncryptionInfo 仅向界面传递非敏感加密状态
type EncryptionInfo struct {
Encrypted bool `json:"encrypted"`
Method string `json:"method,omitempty"`
Users []string `json:"users,omitempty"`
Layers int `json:"layers,omitempty"`
Encrypted bool `json:"encrypted"`
Method string `json:"method,omitempty"`
Users []string `json:"users,omitempty"`
Layers int `json:"layers,omitempty"`
PolicyRequired bool `json:"policyRequired,omitempty"`
}
// Open 打开浏览器内存中的OFD文档
@@ -768,11 +770,14 @@ func exportFormat(value string) (ExportFormat, bool) {
return ExportFormat{}, false
}
// encryptionInfo 获取当前文档的加密来源,不包含凭据
// encryptionInfo 获取当前文档的保存策略,不包含凭据
// 返回: EncryptionInfo 加密状态
func (s *Session) encryptionInfo() EncryptionInfo {
info := s.Reader.Encryption()
return EncryptionInfo{Encrypted: info.Encrypted, Method: info.Method, Users: info.Users, Layers: info.Layers}
if s.editor != nil {
info = s.editor.Encryption()
}
return EncryptionInfo{Encrypted: info.Encrypted, Method: info.Method, Users: info.Users, Layers: info.Layers, PolicyRequired: info.PolicyRequired}
}
// signatureInfos 获取签名验证信息