package http

import "github.com/google/certificate-transparency-go/internal/witness/client/http"

Package http is a simple client for interacting with witnesses over HTTP.

Index

Variables

var ErrSTHTooOld = errors.New("STH too old")

ErrSTHTooOld is returned if the STH passed to Update needs to be updated.

Types

type Witness

type Witness struct {
	URL *url.URL
}

Witness consists of the witness' URL and signature verifier.

func (Witness) GetLatestSTH

func (w Witness) GetLatestSTH(ctx context.Context, logID string) ([]byte, error)

GetLatestSTH returns a recent STH from the witness for the specified log ID.

func (Witness) Update

func (w Witness) Update(ctx context.Context, logID string, sth []byte, proof [][]byte) ([]byte, error)

Update attempts to clock the witness forward for the given logID. The latest signed STH will be returned if this succeeds, or if the error is http.ErrSTHTooOld. In all other cases no STH should be expected.

Source Files

witness_client.go

Version
v1.3.1 (latest)
Published
Jan 15, 2025
Platform
linux/amd64
Imports
11 packages
Last checked
5 days ago

Tools for package owners.