pades

package
v1.115.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package pades seals a PDF with a PAdES baseline signature at level B-LTA: a CAdES signature with a signature timestamp, the validation data in a document security store, and a document timestamp over all of it.

Each step is an incremental update, so every byte of the document as given stays a prefix of the sealed file.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKeyMismatch         = errors.New("the sealing certificate is not for the signer's key")
	ErrReservationTooSmall = errors.New("signature contents larger than reserved")
)

Errors in the sealer's own setup; they are not the document's fault, so none is classed as client input.

Functions

func ByteRangeContent

func ByteRangeContent(data []byte, byteRange [4]int) ([]byte, error)

ByteRangeContent returns what a signature with this byte range covers in the revision it signed, which ends where the range does.

func QualifiedForSeals

func QualifiedForSeals(certificate *x509.Certificate) bool

QualifiedForSeals reports whether the certificate states, in its QC statements, that it is an EU qualified certificate for electronic seals.

Types

type Sealer

type Sealer struct {
	Signer crypto.Signer
	// Certificates is the sealing certificate first, then its issuers.
	Certificates []*x509.Certificate
	Timestamper  tsa.Timestamper
	Collector    *validation_data.Collector
	Now          func() time.Time
}

Sealer seals documents with one key and its certificate chain.

func (*Sealer) Seal

func (s *Sealer) Seal(ctx context.Context, data []byte) ([]byte, error)

Seal returns the document with a B-LTA seal appended as three incremental updates.

Jump to

Keyboard shortcuts

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