parser

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2026 License: Unlicense Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ASN1Extractor

type ASN1Extractor struct {
	Data *SealData
}

ASN1Extractor 用于从ASN.1结构中提取数据的提取器

func NewASN1Extractor

func NewASN1Extractor() *ASN1Extractor

NewASN1Extractor 创建新的ASN1提取器

func (*ASN1Extractor) ExtractFromBytes

func (e *ASN1Extractor) ExtractFromBytes(data []byte) error

ExtractFromBytes 从字节数据中提取

func (*ASN1Extractor) ExtractFromFile

func (e *ASN1Extractor) ExtractFromFile(filename string) error

ExtractFromFile 从文件中提取数据

func (*ASN1Extractor) ExtractFromReader

func (e *ASN1Extractor) ExtractFromReader(r io.Reader) error

ExtractFromReader 从 io.Reader 中提取数据

func (*ASN1Extractor) FindAllValidSequences

func (e *ASN1Extractor) FindAllValidSequences(data []byte) ([]*SealData, error)

FindAllValidSequences 查找所有有效的4元素SEQUENCE

func (*ASN1Extractor) GetSealData

func (e *ASN1Extractor) GetSealData() *SealData

GetSealData 获取提取的签章数据

type Common

type Common struct {
	BaseLoc   models.StLoc
	FileCache *utils.ZipFileCache
}

func (*Common) Init

func (p *Common) Init(fileCache *utils.ZipFileCache, dir models.StLoc)

type Document

type Document struct {
	Common
	models.Document
	Pages       []*Page
	Templates   map[models.StID]*models.PageContent
	DrawParams  map[models.StID]*models.DrawParam
	Res         map[models.StID]*models.MultiMedia
	FontRes     map[models.StID]*models.Font
	PublicRes   []*models.Res
	DocumentRes []*models.Res
	Signs       map[models.StID]*models.Signature
	Seals       map[models.StID][]*SealInfo
	Annotations map[models.StID]*models.PageAnnot
}

func (*Document) GetDrawParam

func (p *Document) GetDrawParam(id models.StID) *models.DrawParam

func (*Document) ParseSigns

func (p *Document) ParseSigns(file *models.StLoc) error

type OFD

type OFD struct {
	models.OFD

	Documents []*Document
	// contains filtered or unexported fields
}

OFD 表示一个OFD文档解析器

func NewOFD

func NewOFD(file interface{}) (*OFD, error)

func (*OFD) Close

func (p *OFD) Close() error

Close 关闭OFD解析器并释放资源

func (*OFD) Open

func (p *OFD) Open(input interface{}) error

Open 打开OFD文件,支持文件路径或字节数据

type Page

type Page struct {
	models.PageContent
	ID models.StID
}

type SealData

type SealData struct {
	FileType string // 文件类型: png, ofd, jpg, jpeg
	Data     []byte // 提取的字节数据
}

SealData 存储提取的签章数据

func ExtractSealData

func ExtractSealData(source interface{}) (*SealData, error)

ExtractSealData 通用提取函数,支持多种输入

type SealInfo

type SealInfo struct {
	StampAnnot *models.StampAnnot
	SealData   *SealData
}

type Signature

type Signature struct {
	ID      models.StID  `xml:"ID,attr"`
	BaseLoc models.StLoc `xml:"BaseLoc,attr"`
}

type Signatures

type Signatures struct {
	XMLName    xml.Name    `xml:"Signatures"`
	Xmlns      string      `xml:"xmlns,attr"`
	MaxSignID  *string     `xml:"MaxSignId,omitempty"`
	Signatures []Signature `xml:"Signature,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL