mtpublisher

package
v0.20261105.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: MPL-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(checkpointDB checkpointDB, interval time.Duration, logID *issuancelog.ID, caVerifier *cosignature.Verifier, mirror Mirror, log blog.Logger) (*mtpublisher, error)

New returns a publisher for the issuance log logID. It reconstructs each checkpoint's signed note from the stored MTCA signature, verified with caVerifier, and obtains each cosignature from mirror, which verifies it before returning it.

Types

type Mirror added in v0.20260908.0

type Mirror interface {
	// ID returns the mirror's cosigner ID.
	ID() string
	// SubmitCheckpoint submits the log's signed note for cp and returns the
	// mirror's cosignature line, verified against the mirror's key.
	SubmitCheckpoint(ctx context.Context, cp *checkpoint.Checkpoint, signedNote []byte) ([]byte, error)
	// LatestCheckpoint returns the mirror's checkpoint of the log with origin
	// and the mirror's cosignature line on it, verified against the mirror's
	// key. The mirror signs the subtrees the checkpoint includes.
	LatestCheckpoint(ctx context.Context, origin string) (*checkpoint.Checkpoint, []byte, error)
	// CosignSubtree returns the mirror's signature over the subtree [start,
	// end) of mirrored, the mirror's checkpoint from LatestCheckpoint,
	// verified against the mirror's key. It errors if the mirror's checkpoint
	// does not include the subtree.
	CosignSubtree(ctx context.Context, mirrored *checkpoint.Checkpoint, mirrorLine []byte, start, end int64, subtreeHash tlog.Hash) ([]byte, error)
}

Mirror cosigns checkpoints, requiring the entries they commit to before signing.

https://c2sp.org/tlog-cosignature

type MirrorClient added in v0.20260908.0

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

MirrorClient is a Mirror that uses the c2sp.org/tlog-mirror submission protocol, submitting the checkpoint to add-checkpoint and uploading the log's entries to add-entries until the mirror cosigns.

func NewMirrorClient added in v0.20260908.0

func NewMirrorClient(baseURL, monitoringPrefix string, src *Source, mirrorID string, mirrorPublicKey *mldsa.PublicKey, timeout time.Duration) (*MirrorClient, error)

NewMirrorClient returns a MirrorClient that submits to the mirror's endpoints under baseURL and reads its checkpoint under monitoringPrefix, giving each request timeout to complete.

func (*MirrorClient) CosignSubtree added in v0.20261027.0

func (m *MirrorClient) CosignSubtree(ctx context.Context, mirrored *checkpoint.Checkpoint, mirrorLine []byte, start, end int64, subtreeHash tlog.Hash) ([]byte, error)

CosignSubtree returns the mirror's signature over the subtree [start, end) from sign-subtree, proven against the mirror's own checkpoint.

func (*MirrorClient) ID added in v0.20260908.0

func (m *MirrorClient) ID() string

ID returns the mirror's cosigner ID.

func (*MirrorClient) LatestCheckpoint added in v0.20261027.0

func (m *MirrorClient) LatestCheckpoint(ctx context.Context, origin string) (*checkpoint.Checkpoint, []byte, error)

LatestCheckpoint returns the mirror's checkpoint of the log with the given origin and the mirror's cosignature line on it, verified.

https://c2sp.org/tlog-mirror#introduction

func (*MirrorClient) SubmitCheckpoint added in v0.20261027.0

func (m *MirrorClient) SubmitCheckpoint(ctx context.Context, cp *checkpoint.Checkpoint, signedNoteForMirror []byte) ([]byte, error)

SubmitCheckpoint runs the c2sp.org/tlog-mirror submission protocol for the checkpoint and returns the mirror's cosignature line from add-entries, verified against the mirror's key. A mirror that is already up to date, whether from an earlier submission whose cosignature was never stored or from another submitter, still gets the full exchange, since that is the only way to obtain its cosignature.

type Source added in v0.20260908.0

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

Source builds consistency proofs and entry packages from the log's tile storage. In the future, when we want to support multiple mirrors, we may want to improve Source to memoize the tiles, consistency proofs, and entry packages built for the latest tree, purging the memo when the tree changes.

func NewSource added in v0.20260908.0

func NewSource(s3c simpleS3, tilePrefix string) *Source

NewSource returns a Source over the tiles stored in s3c under tilePrefix.

Directories

Path Synopsis
Package mtpublishertest provides an in-process cosigner for unit tests of the mtca and the mtpublisher.
Package mtpublishertest provides an in-process cosigner for unit tests of the mtca and the mtpublisher.

Jump to

Keyboard shortcuts

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