sighandler

package
v0.0.0-...-a2e00f7 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package sighandler implements digital signature handlers for PDF signature validation and signing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAdobePKCS7Detached

func NewAdobePKCS7Detached(privateKey *rsa.PrivateKey, certificate *x509.Certificate) (model.SignatureHandler, error)

NewAdobePKCS7Detached creates a new Adobe.PPKMS/Adobe.PPKLite adbe.pkcs7.detached signature handler. Both parameters may be nil for the signature validation.

func NewAdobeX509RSASHA1

func NewAdobeX509RSASHA1(privateKey *rsa.PrivateKey, certificate *x509.Certificate) (model.SignatureHandler, error)

NewAdobeX509RSASHA1 creates a new Adobe.PPKMS/Adobe.PPKLite adbe.x509.rsa_sha1 signature handler. Both parameters may be nil for the signature validation.

func NewAdobeX509RSASHA1Custom

func NewAdobeX509RSASHA1Custom(certificate *x509.Certificate, signFunc SignFunc) (model.SignatureHandler, error)

NewAdobeX509RSASHA1Custom creates a new Adobe.PPKMS/Adobe.PPKLite adbe.x509.rsa_sha1 signature handler with a custom signing function. Both parameters may be nil for the signature validation.

func NewDocTimeStamp

func NewDocTimeStamp(timestampServerURL string, hashAlgorithm crypto.Hash) (model.SignatureHandler, error)

NewDocTimeStamp creates a new DocTimeStamp signature handler. The timestampServerURL parameter can be empty string for the signature validation. The hashAlgorithm parameter can be crypto.SHA1, crypto.SHA256, crypto.SHA384, crypto.SHA512.

func NewEmptyAdobePKCS7Detached

func NewEmptyAdobePKCS7Detached(signatureLen int) (model.SignatureHandler, error)

NewEmptyAdobePKCS7Detached creates a new Adobe.PPKMS/Adobe.PPKLite adbe.pkcs7.detached signature handler. The generated signature is empty and of size signatureLen. The signatureLen parameter can be 0 for the signature validation.

Types

type SignFunc

type SignFunc func(sig *model.PdfSignature, digest model.Hasher) ([]byte, error)

SignFunc represents a custom signing function. The function should return the computed signature.

Jump to

Keyboard shortcuts

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