Documentation
¶
Index ¶
- Constants
- Variables
- func ConvertTileLeafToRawLogEntry(leaf TileLeaf, index uint64) *ct.RawLogEntry
- func ParseCertstreamEntry(rawEntry *ct.RawLogEntry, operatorName, logname, ctURL, logType string) (models.Entry, error)
- type HTTPLogListFetcher
- type LogListFetcher
- type StaticCTClient
- type TileLeaf
- type TiledCheckpoint
- type Watcher
Constants ¶
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.
const TileSize = 256
Variables ¶
var ( EntryTypeCert uint16 EntryTypePrecert uint16 = 1 )
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") )
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
type LogListFetcher ¶ added in v1.10.0
type StaticCTClient ¶ added in v1.10.0
type StaticCTClient struct {
// contains filtered or unexported fields
}
func NewStaticCTClient ¶ added in v1.10.0
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
ParseTileData parses the binary tile data into TileLeaf entries using cryptobyte.
type TiledCheckpoint ¶ added in v1.9.0
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 NewWatcherWithChannel ¶ added in v1.10.0
NewWatcherWithChannel creates a new Watcher and initializes it with the provided cert channel.
func (*Watcher) CreateIndexFile ¶ added in v1.9.0
CreateIndexFile creates a ct_index.json file based on the current STHs of all available logs.