sign

package
v0.0.0-...-5d8e3e1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2025 License: BSD-3-Clause, BSD-2-Clause Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnnotationFlagInvisible      = 1 << 0
	AnnotationFlagHidden         = 1 << 1
	AnnotationFlagPrint          = 1 << 2
	AnnotationFlagNoZoom         = 1 << 3
	AnnotationFlagNoRotate       = 1 << 4
	AnnotationFlagNoView         = 1 << 5
	AnnotationFlagReadOnly       = 1 << 6
	AnnotationFlagLocked         = 1 << 7
	AnnotationFlagToggleNoView   = 1 << 8
	AnnotationFlagLockedContents = 1 << 9
)

Define annotation flag constants.

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)

EncodePNGSUBBytes encodes data using PNG SUB filter.

func EncodePNGUPBytes

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

EncodePNGUPBytes encodes data using PNG UP filter.

func SignFile

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

func SignPDF

func SignPDF(inputBytes []byte, dataSign SignData) ([]byte, error)

Types

type Appearance

type Appearance struct {
	Visible     bool
	Page        uint32
	LowerLeftX  float64
	LowerLeftY  float64
	UpperRightX float64
	UpperRightY float64
}

Appearance represents the appearance of the signature

type CatalogData

type CatalogData struct {
	ObjectId   uint32
	RootString string
}

type CertType

type CertType uint
const (
	CertificationSignature CertType = iota + 1
	ApprovalSignature
	UsageRightsSignature
	TimeStampSignature
)

func (CertType) String

func (i CertType) String() string

type DocMDPPerm

type DocMDPPerm uint
const (
	DoNotAllowAnyChangesPerms DocMDPPerm = iota + 1
	AllowFillingExistingFormFieldsAndSignaturesPerms
	AllowFillingExistingFormFieldsAndSignaturesAndCRUDAnnotationsPerms
)

func (DocMDPPerm) String

func (i DocMDPPerm) String() string

type InfoData

type InfoData struct {
	ObjectId uint32
}

type RevocationFunction

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

type SignContext

type SignContext struct {
	InputFile              io.ReadSeeker
	OutputFile             io.Writer
	OutputBuffer           *filebuffer.Buffer
	SignData               SignData
	CatalogData            CatalogData
	VisualSignData         VisualSignData
	InfoData               InfoData
	PDFReader              *pdf.Reader
	NewXrefStart           int64
	ByteRangeValues        []int64
	SignatureMaxLength     uint32
	SignatureMaxLengthBase uint32
	// contains filtered or unexported fields
}

func (*SignContext) GetTSA

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

type SignData

type SignData struct {
	Signature          SignDataSignature
	Signer             crypto.Signer
	DigestAlgorithm    crypto.Hash
	Certificate        *x509.Certificate
	CertificateChains  [][]*x509.Certificate
	TSA                TSA
	RevocationData     revocation.InfoArchival
	RevocationFunction RevocationFunction
	Appearance         Appearance
	// contains filtered or unexported fields
}

type SignDataSignature

type SignDataSignature struct {
	CertType   CertType
	DocMDPPerm DocMDPPerm
	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 {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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