voucher

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const VoucherTypePeerMembership = "peer_membership"

Variables

This section is empty.

Functions

func Canonicalize

func Canonicalize(v *VoucherData) ([]byte, error)

Canonicalize serializes VoucherData to canonical JSON (alphabetical key order, no whitespace, no trailing newline, UTF-8).

func NonceFromData

func NonceFromData(canonical []byte) []byte

NonceFromData computes the SHA-256 hash of canonical JSON bytes. The raw 32-byte hash is returned for direct use as TPM qualifyingData.

Types

type VoucherData

type VoucherData struct {
	AccountID             string `json:"account_id"`
	Epoch                 int    `json:"epoch"`
	FoundingEKFingerprint string `json:"founding_ek_fingerprint"`
	IssuedAt              string `json:"issued_at"`
	IssuerEKFingerprint   string `json:"issuer_ek_fingerprint"`
	SubjectEKFingerprint  string `json:"subject_ek_fingerprint"`
	Type                  string `json:"type"`
	Version               int    `json:"version"`
}

VoucherData is the payload attested by a TPM quote. Fields are declared in alphabetical order so json.Marshal produces canonical (alphabetically-ordered keys) JSON for deterministic nonce derivation.

Jump to

Keyboard shortcuts

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