integration

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCustomHandler

func NewCustomHandler(initFunc InitFunc, signFunc SignFunc) model.SignatureHandler

NewCustomHandler allow client to implement their own init and sign function

func NewGlobalSignDSS

func NewGlobalSignDSS(ctx context.Context, m *globalsign.Manager, signer string, identity map[string]interface{}) (model.SignatureHandler, error)

NewGlobalSignDSS create custom unidoc sighandler which leverage globalsign DSS service this handler assume that globalsign credential already have been set please see globalsign.SetupCredential

func NewSigner

func NewSigner(cb SignerCallback) crypto.Signer

NewSigner create crypto.Signer implementation

Types

type CertificateChainGetter

type CertificateChainGetter interface {
	GetCertificateChain() []*x509.Certificate
}

type CustomHandler

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

func (*CustomHandler) InitSignature

func (h *CustomHandler) InitSignature(sig *model.PdfSignature) error

InitSignature .

func (*CustomHandler) IsApplicable

func (h *CustomHandler) IsApplicable(sig *model.PdfSignature) bool

IsApplicable .

func (*CustomHandler) NewDigest

func (h *CustomHandler) NewDigest(sig *model.PdfSignature) (model.Hasher, error)

NewDigest .

func (*CustomHandler) Sign

func (h *CustomHandler) Sign(sig *model.PdfSignature, digest model.Hasher) error

Sign .

func (*CustomHandler) Validate

Validate .

type GlobalsignDSS

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

GlobalsignDSS is custom unidoc sighandler which leverage globalsign DSS service

func (*GlobalsignDSS) GetCertificateChain

func (h *GlobalsignDSS) GetCertificateChain() []*x509.Certificate

func (*GlobalsignDSS) InitSignature

func (h *GlobalsignDSS) InitSignature(sig *model.PdfSignature) error

InitSignature sets the PdfSignature parameters.

func (*GlobalsignDSS) IsApplicable

func (h *GlobalsignDSS) IsApplicable(sig *model.PdfSignature) bool

IsApplicable .

func (*GlobalsignDSS) NewDigest

func (h *GlobalsignDSS) NewDigest(sig *model.PdfSignature) (model.Hasher, error)

NewDigest .

func (*GlobalsignDSS) Sign

func (h *GlobalsignDSS) Sign(sig *model.PdfSignature, digest model.Hasher) error

Sign .

func (*GlobalsignDSS) Validate

Validate .

type InitFunc

InitFunc allow customize pdf signature initialization

type SignFunc

SignFunc allow customize signing implementation

type Signer

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

Signer implements custom crypto.Signer which utilize globalsign DSS API to sign signature digest

func (*Signer) EncryptionAlgorithmOID

func (s *Signer) EncryptionAlgorithmOID() asn1.ObjectIdentifier

func (*Signer) Public

func (s *Signer) Public() crypto.PublicKey

Public .

func (*Signer) Sign

func (s *Signer) Sign(rand io.Reader, digest []byte, opts crypto.SignerOpts) (signature []byte, err error)

Sign request

type SignerCallback

type SignerCallback func(rand io.Reader, digest []byte, opts crypto.SignerOpts) ([]byte, error)

SignerCallback .

Jump to

Keyboard shortcuts

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