fixture

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: Apache-2.0 Imports: 18 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package fixture builds synthetic, fully valid evidence packages for tests and demos, optionally with a single injected fault. All keys come from an ephemeral devpki.Set; no real data is used.

Index

Constants

View Source
const EvidenceKID = "dev-evidence-1"

EvidenceKID is the key ID of the evidence signing key in fixture key lists.

Variables

This section is empty.

Functions

func Evidence

func Evidence(now time.Time, original, final []byte, pages int) *evidence.Evidence

Evidence returns synthetic evidence for a completed sequential request with two signers. Event hashes are not yet linked.

func SyntheticPDF

func SyntheticPDF(lines ...string) []byte

SyntheticPDF returns a one-page PDF 1.7 with the given lines in Helvetica.

Types

type Faults

type Faults struct {
	// BreakChain alters one event's prev_hash after linking, then signs and
	// timestamps normally.
	BreakChain bool
	// WrongKey signs the evidence with a key that is not the listed one.
	WrongKey bool
	// BadTimestamp stores a token over different bytes than evidence.jws.
	BadTimestamp bool
	// MissingSignature drops the second signer's signer.signed event.
	MissingSignature bool
}

Faults selects at most one defect to inject into a built package.

type Fixture

type Fixture struct {
	// Zip is the evidence package; Original and Final are the PDF before and after sealing.
	Zip, Original, Final []byte
	// RootThumbprint is the key-list root a verifier pins.
	RootThumbprint string
	// SealRoots and TSARoots hold the trust anchors for the seal and timestamp chains.
	SealRoots, TSARoots *x509.CertPool
	// PKI is the key material the package was built with.
	PKI *devpki.Set
	// Now is the build time.
	Now time.Time
}

Fixture is a built evidence package and what a verifier needs to check it.

func Build

func Build(ctx context.Context, pki *devpki.Set, f Faults) (*Fixture, error)

Build creates a package for a sequential two-signer request.

Jump to

Keyboard shortcuts

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