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 ¶
var ( ErrKeyMismatch = errors.New("the sealing certificate is not for the signer's key") ErrReservationTooSmall = errors.New("signature contents larger than reserved") // ErrCertificateNotValid is a sealing certificate whose validity does not hold now: expired, or not valid yet. A seal // made with it fails validation whatever else holds, so none is made. ErrCertificateNotValid = errors.New("the sealing certificate is not valid now") )
Errors in the sealer's own setup; they are not the document's fault, so none is classed as client input.
var ErrInvalidRectangle = errors.New("invalid field rectangle")
ErrInvalidRectangle is a field rectangle that is not a box on a page.
Functions ¶
func ByteRangeContent ¶
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 Rectangle ¶ added in v1.116.0
Rectangle is a box on a page, in points from its lower-left corner.
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
// SealRectangle places the seal's field on the last page, over what the page prints for it, so a reader opens its check of the seal there; nil leaves the field off the page.
SealRectangle *Rectangle
Now func() time.Time
}
Sealer seals documents with one key and its certificate chain.