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 ¶
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 ¶
Evidence returns synthetic evidence for a completed sequential request with two signers. Event hashes are not yet linked.
func SyntheticPDF ¶
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.