Documentation ¶
Overview ¶
Package witness is designed to make sure the STHs of CT logs are consistent and store/serve/sign them if so. It is expected that a separate feeder component would be responsible for the actual interaction with logs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Witness ¶
type Witness struct { Logs map[string]ct.SignatureVerifier // contains filtered or unexported fields }
Witness consists of a database for storing STHs, a signing key, and a list of logs for which it stores and verifies STHs.
func (*Witness) GetSTH ¶
GetSTH gets a cosigned STH for a given log, which is consistent with all other STHs for the same log signed by this witness.
func (*Witness) Update ¶
func (w *Witness) Update(ctx context.Context, logID string, nextRaw []byte, pf [][]byte) ([]byte, error)
Update updates the latest STH if nextRaw is consistent with the current latest one for this log. It returns the latest cosigned STH held by the witness, which is a signed version of nextRaw if the update was applied.