Documentation ¶
Index ¶
- func NewCustomHandler(initFunc InitFunc, signFunc SignFunc) model.SignatureHandler
- func NewGlobalSignDSS(ctx context.Context, m *globalsign.Manager, signer string, ...) (model.SignatureHandler, error)
- func NewSigner(cb SignerCallback) crypto.Signer
- type CertificateChainGetter
- type CustomHandler
- func (h *CustomHandler) InitSignature(sig *model.PdfSignature) error
- func (h *CustomHandler) IsApplicable(sig *model.PdfSignature) bool
- func (h *CustomHandler) NewDigest(sig *model.PdfSignature) (model.Hasher, error)
- func (h *CustomHandler) Sign(sig *model.PdfSignature, digest model.Hasher) error
- func (h *CustomHandler) Validate(sig *model.PdfSignature, digest model.Hasher) (model.SignatureValidationResult, error)
- type GlobalsignDSS
- func (h *GlobalsignDSS) GetCertificateChain() []*x509.Certificate
- func (h *GlobalsignDSS) InitSignature(sig *model.PdfSignature) error
- func (h *GlobalsignDSS) IsApplicable(sig *model.PdfSignature) bool
- func (h *GlobalsignDSS) NewDigest(sig *model.PdfSignature) (model.Hasher, error)
- func (h *GlobalsignDSS) Sign(sig *model.PdfSignature, digest model.Hasher) error
- func (h *GlobalsignDSS) Validate(sig *model.PdfSignature, digest model.Hasher) (model.SignatureValidationResult, error)
- type InitFunc
- type SignFunc
- type Signer
- type SignerCallback
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 ¶
func (h *CustomHandler) Validate(sig *model.PdfSignature, digest model.Hasher) (model.SignatureValidationResult, error)
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 ¶
func (h *GlobalsignDSS) Validate(sig *model.PdfSignature, digest model.Hasher) (model.SignatureValidationResult, error)
Validate .
type InitFunc ¶
type InitFunc func(model.SignatureHandler, *model.PdfSignature) error
InitFunc allow customize pdf signature initialization
type SignFunc ¶
type SignFunc func(model.SignatureHandler, *model.PdfSignature, model.Hasher) error
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
type SignerCallback ¶
SignerCallback .