signpdf

package
v0.0.0-...-9a1ea71 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DocMdpNoChanges allows no changes to the document after signing.
	DocMdpNoChanges DocMdp = "no-changes"

	// DocMdpFormSign allows form fill-in and adding additional digital signatures after signing.
	DocMdpFormSign = "form-sign"

	// DocMdpFormSignAnnot allows form fill-in, adding additional digital signatures, and adding annotations (for example commenting), post-signing.
	DocMdpFormSignAnnot = "form-sign-annot"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DigitorusPdfSigner

type DigitorusPdfSigner struct {
	// contains filtered or unexported fields
}

func NewDigitorusPdfSigner

func NewDigitorusPdfSigner(key crypto.Signer, cert *x509.Certificate, certChains [][]*x509.Certificate) *DigitorusPdfSigner

func (*DigitorusPdfSigner) Sign

func (ps *DigitorusPdfSigner) Sign(input io.ReadSeeker, output io.Writer, signInfo *SignInfo) error

func (*DigitorusPdfSigner) SignDigitorus

func (ps *DigitorusPdfSigner) SignDigitorus(input, output string, signData *pdfsign.SignDataSignature) error

type DocMdp

type DocMdp string

DocMdp (DocMDP) stands for Document Modification Detection and Prevention; only to be used beside SignTypeCert.

func (DocMdp) ToDigitorusModel

func (dm DocMdp) ToDigitorusModel() pdfsign.DocMDPPerm

type PdfCpuSignPdfSigner

type PdfCpuSignPdfSigner struct {
	// contains filtered or unexported fields
}

func NewPdfCpuSignPdfSigner

func NewPdfCpuSignPdfSigner(
	pvKey crypto.PrivateKey,
	cert *x509.Certificate,
	certParents []*x509.Certificate,
) *PdfCpuSignPdfSigner

func (*PdfCpuSignPdfSigner) Sign

func (ps *PdfCpuSignPdfSigner) Sign(input io.ReadSeeker, output io.Writer, signInfo *SignInfo) error

type PdfSigner

type PdfSigner interface {
	Sign(input io.ReadSeeker, output io.Writer, signInfo *SignInfo) error
}

type SignInfo

type SignInfo struct {
	Type       SignType
	DocMdp     DocMdp
	SignerInfo *SignerInfo
}

SignInfo holds a signing procedure information; it is only designed to be used in unmarshal positions (and not marshal positions) regarding ser/deserialization.

func (*SignInfo) ToDigitorusModel

func (si *SignInfo) ToDigitorusModel() *pdfsign.SignDataSignature

type SignType

type SignType string

SignType defines the signature type to use.

const (
	// SignTypeCert is a signature type that can be applied once to a PDF document (it must be the first signature),
	// and is always to be associated with the DocMDP field.
	SignTypeCert SignType = "certification"

	// SignTypeApproval is a signature type that can be applied multiple times to a PDF document.
	SignTypeApproval = "approval"
)

func (SignType) ToDigitorusModel

func (st SignType) ToDigitorusModel() pdfsign.CertType

type SignerInfo

type SignerInfo struct {
	Name        string
	Location    string
	Reason      string
	ContactInfo string
	Time        time.Time
}

SignerInfo holds the signer (usually a person or a company) information; it is only designed to be used in unmarshal positions (and not marshal positions) regarding ser/deserialization.

func (*SignerInfo) ToDigitorusModel

func (si *SignerInfo) ToDigitorusModel() *pdfsign.SignDataSignatureInfo

Jump to

Keyboard shortcuts

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