sign

package
v0.0.0-...-4c31ea4 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: GPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CertificationSignature = iota + 1
	ApprovalSignature
	UsageRightsSignature
)
View Source
const (
	DoNotAllowAnyChangesPerms = iota + 1
	AllowFillingExistingFormFieldsAndSignaturesPerms
	AllowFillingExistingFormFieldsAndSignaturesAndCRUDAnnotationsPerms
)

Variables

This section is empty.

Functions

func DefaultEmbedRevocationStatusFunction

func DefaultEmbedRevocationStatusFunction(cert, issuer *x509.Certificate, i *revocation.InfoArchival) error

func EncodePNGSUBBytes

func EncodePNGSUBBytes(columns int, data []byte) ([]byte, error)

func EncodePNGUPBytes

func EncodePNGUPBytes(columns int, data []byte) ([]byte, error)

func Sign

func Sign(input io.ReadSeeker, output io.Writer, rdr *pdf.Reader, size int64, sign_data SignData) error

func SignFile

func SignFile(input string, output string, sign_data SignData) error

Types

type CatalogData

type CatalogData struct {
	ObjectId   uint32
	Length     int64
	RootString string
}

type InfoData

type InfoData struct {
	ObjectId uint32
	Length   int64
}

type RevocationFunction

type RevocationFunction func(cert, issuer *x509.Certificate, i *revocation.InfoArchival) error

type SignContext

type SignContext struct {
	Filesize                   int64
	InputFile                  io.ReadSeeker
	OutputFile                 io.Writer
	OutputBuffer               *filebuffer.Buffer
	SignData                   SignData
	CatalogData                CatalogData
	VisualSignData             VisualSignData
	InfoData                   InfoData
	PDFReader                  *pdf.Reader
	NewXrefStart               int64
	ByteRangeStartByte         int64
	SignatureContentsStartByte int64
	ByteRangeValues            []int64
	SignatureMaxLength         uint32
	SignatureMaxLengthBase     uint32
}

func (*SignContext) GetTSA

func (context *SignContext) GetTSA(sign_content []byte) (timestamp_response []byte, err error)

func (*SignContext) SignPDF

func (context *SignContext) SignPDF() error

type SignData

type SignData struct {
	ObjectId           uint32
	Signature          SignDataSignature
	Signer             crypto.Signer
	DigestAlgorithm    crypto.Hash
	Certificate        *x509.Certificate
	CertificateChains  [][]*x509.Certificate
	TSA                TSA
	RevocationData     revocation.InfoArchival
	RevocationFunction RevocationFunction
}

type SignDataSignature

type SignDataSignature struct {
	CertType   uint
	DocMDPPerm uint
	Info       SignDataSignatureInfo
}

type SignDataSignatureInfo

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

type TSA

type TSA struct {
	URL      string
	Username string
	Password string
}

type VisualSignData

type VisualSignData struct {
	ObjectId uint32
	Length   int64
}

Jump to

Keyboard shortcuts

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