Documentation
¶
Overview ¶
Package pack produces evidence packages and signed key lists in the format defined by package evidence.
Index ¶
- func Assemble(ctx context.Context, requestID string, evidenceJSON []byte, in Input) ([]byte, error)
- func Build(ctx context.Context, ev *evidence.Evidence, in Input) ([]byte, error)
- func Link(events []evidence.Event) error
- func NewManifest(requestID string, files map[string][]byte) ([]byte, error)
- func SignJWS(s crypto.Signer, kid string, payload []byte) ([]byte, error)
- func SignKeyList(root crypto.Signer, kl evidence.KeyList) ([]byte, error)
- func WriteZip(files map[string][]byte) ([]byte, error)
- type Input
- type Timestamper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Build ¶
Build links ev's events, canonicalises it and assembles the package. The caller fills ev.Document from the original and final PDFs.
func NewManifest ¶
NewManifest returns the canonical manifest for files (manifest excluded).
func SignKeyList ¶
SignKeyList signs the canonical key list with the root key as a flattened JWS JSON document carrying the root public key in its protected header.
Types ¶
type Input ¶
type Input struct {
// Original and Final are the PDFs stored as original.pdf and final.pdf.
Original []byte
Final []byte
// SealChain is the seal certificate followed by its intermediates.
SealChain []*x509.Certificate
// KeyList is the signed key list stored as keys/keys.json.
KeyList []byte
// Signer signs evidence.json with ES256; KeyID is the kid in the JWS
// header and must appear in KeyList.
Signer crypto.Signer
KeyID string
// Timestamper timestamps the evidence signature.
Timestamper Timestamper
}
Input is what a package needs besides evidence.json.