certificatetransparency

package
v1.10.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMaxPartialWait = 1 * time.Minute

DefaultMaxPartialWait is the default maximum time to wait before forcefully fetching a partial tile that has not yet grown into a full tile.

View Source
const TileSize = 256

Variables

View Source
var (
	EntryTypeCert    uint16
	EntryTypePrecert uint16 = 1
)
View Source
var (
	ErrCreatingClient          = errors.New("failed to create JSON client")
	ErrFetchingSTHFailed       = errors.New("failed to fetch STH")
	ErrCheckpointInvalidFormat = errors.New("invalid checkpoint format: expected at least 3 lines")
	ErrInvalidDataTile         = errors.New("invalid data tile precert_entry")
	ErrRequestFailed           = errors.New("request failed")
	ErrUnknownEntryType        = errors.New("unknown entry type")
	ErrInvalidFingerprint      = errors.New("invalid fingerprint")
	ErrEntryNil                = errors.New("entry is nil")
	ErrNoCertFound             = errors.New("no certificate found")
)
View Source
var UserAgent = fmt.Sprintf("Certstream Server v%s (github.com/d-Rickyy-b/certstream-server-go)", config.Version)

Functions

func ConvertTileLeafToRawLogEntry added in v1.9.0

func ConvertTileLeafToRawLogEntry(leaf TileLeaf, index uint64) *ct.RawLogEntry

ConvertTileLeafToRawLogEntry converts a TileLeaf to ct.RawLogEntry for compatibility.

func ParseCertstreamEntry added in v1.8.0

func ParseCertstreamEntry(rawEntry *ct.RawLogEntry, operatorName, logname, ctURL, logType string) (models.Entry, error)

ParseCertstreamEntry creates an Entry from a ct.RawLogEntry.

Types

type HTTPLogListFetcher added in v1.10.0

type HTTPLogListFetcher struct {
	LogListURL string
}

func NewHTTPLogListFetcher added in v1.10.0

func NewHTTPLogListFetcher(url string) *HTTPLogListFetcher

func (*HTTPLogListFetcher) Fetch added in v1.10.0

func (f *HTTPLogListFetcher) Fetch() (loglist3.LogList, error)

Fetch fetches the list of all CT logs from the provided LogList URL.

type LogListFetcher added in v1.10.0

type LogListFetcher interface {
	Fetch() (loglist3.LogList, error)
}

type StaticCTClient added in v1.10.0

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

func NewStaticCTClient added in v1.10.0

func NewStaticCTClient(url string, httpClient *http.Client, userAgent string, startIndex uint64) *StaticCTClient

func (*StaticCTClient) FetchCheckpoint added in v1.10.0

func (s *StaticCTClient) FetchCheckpoint(ctx context.Context) (*TiledCheckpoint, error)

FetchCheckpoint fetches the checkpoint from a tiled CT log using the provided client.

func (*StaticCTClient) Monitor added in v1.10.0

func (s *StaticCTClient) Monitor(ctx context.Context, foundCert, foundPrecert func(*ct.RawLogEntry)) error

Monitor continuously monitors the tiled CT log for new entries, starting from the current ctIndex.

type TileLeaf added in v1.9.0

type TileLeaf struct {
	Timestamp     uint64
	EntryType     uint16
	X509Entry     []byte // For X.509 certificates
	PrecertEntry  []byte // For precertificates
	Chain         [][]byte
	IssuerKeyHash [32]byte
}

TileLeaf represents a single entry in a tile.

func ParseTileData added in v1.9.0

func ParseTileData(data []byte) ([]TileLeaf, error)

ParseTileData parses the binary tile data into TileLeaf entries using cryptobyte.

type TiledCheckpoint added in v1.9.0

type TiledCheckpoint struct {
	Origin string
	Size   uint64
	Hash   string
}

TiledCheckpoint represents the checkpoint information from a tiled CT log.

func FetchCheckpoint added in v1.9.0

func FetchCheckpoint(ctx context.Context, client *http.Client, baseURL string) (*TiledCheckpoint, error)

FetchCheckpoint fetches the checkpoint from a tiled CT log using the provided client.

type Watcher

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

Watcher is a central component within certstream-server-go. It manages the workers for all the monitored ct logs. It keeps track of all the monitored logs and periodically checks for new logs that aren't monitored yet.

func NewWatcher added in v1.5.0

func NewWatcher() *Watcher

NewWatcher creates a new Watcher.

func NewWatcherWithChannel added in v1.10.0

func NewWatcherWithChannel(certChan chan models.Entry) *Watcher

NewWatcherWithChannel creates a new Watcher and initializes it with the provided cert channel.

func (*Watcher) CreateIndexFile added in v1.9.0

func (w *Watcher) CreateIndexFile(filePath string) error

CreateIndexFile creates a ct_index.json file based on the current STHs of all available logs.

func (*Watcher) Start

func (w *Watcher) Start()

Start starts the watcher. This method is blocking.

func (*Watcher) Stop

func (w *Watcher) Stop()

Stop stops the watcher.

Jump to

Keyboard shortcuts

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