validation

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CRLChecker

type CRLChecker struct {
	Client *http.Client
}

CRLChecker implements RevocationChecker using CRLs.

func NewCRLChecker

func NewCRLChecker() *CRLChecker

func (*CRLChecker) Check

func (c *CRLChecker) Check(ctx context.Context, cert *x509.Certificate, issuer *x509.Certificate) (RevocationStatus, error)

type ChainBuilder

type ChainBuilder interface {
	// BuildChain attempts to build a valid chain from the leaf certificate to a trusted root.
	BuildChain(leaf *x509.Certificate, intermediates []*x509.Certificate, roots *x509.CertPool) ([][]*x509.Certificate, error)
}

ChainBuilder builds and verifies X.509 certificate chains.

type ChainBuilderImpl

type ChainBuilderImpl struct {
}

func NewChainBuilder

func NewChainBuilder() *ChainBuilderImpl

func (*ChainBuilderImpl) BuildChain

func (b *ChainBuilderImpl) BuildChain(leaf *x509.Certificate, intermediates []*x509.Certificate, roots *x509.CertPool) ([][]*x509.Certificate, error)

type LTVManager

type LTVManager interface {
	// AddValidationInfo adds validation information (certs, OCSP, CRLs) to the DSS.
	AddValidationInfo(ctx context.Context, doc *semantic.Document, vri *ValidationRelatedInfo) error
}

LTVManager manages Long Term Validation (LTV) information in the PDF. It handles the Document Security Store (DSS) dictionary.

type LTVManagerImpl

type LTVManagerImpl struct{}

func NewLTVManager

func NewLTVManager() *LTVManagerImpl

func (*LTVManagerImpl) AddValidationInfo

func (m *LTVManagerImpl) AddValidationInfo(ctx context.Context, doc *semantic.Document, vri *ValidationRelatedInfo) error

type OCSPChecker

type OCSPChecker struct {
	Client *http.Client
}

OCSPChecker implements RevocationChecker using OCSP.

func NewOCSPChecker

func NewOCSPChecker() *OCSPChecker

func (*OCSPChecker) Check

type RevocationChecker

type RevocationChecker interface {
	// Check checks if the certificate is revoked.
	Check(ctx context.Context, cert *x509.Certificate, issuer *x509.Certificate) (RevocationStatus, error)
}

RevocationChecker checks the revocation status of a certificate.

type RevocationStatus

type RevocationStatus int

RevocationStatus represents the status of a certificate.

const (
	StatusGood RevocationStatus = iota
	StatusRevoked
	StatusUnknown
)

type ValidationRelatedInfo

type ValidationRelatedInfo struct {
	Certs [][]byte // DER encoded certificates
	OCSPs [][]byte // DER encoded OCSP responses
	CRLs  [][]byte // DER encoded CRLs
}

ValidationRelatedInfo contains the validation data to be added.

Jump to

Keyboard shortcuts

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