timestamp

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package timestamp implements ports.TimestampAuthority with an RFC-3161 client: it anchors a custody chain head to an EXTERNAL trusted timestamp, so a head can be proven to have existed before a given instant independent of the server's own ed25519 key – i.e. tamper-PROOF, not just tamper-evident (append-only, tamper-evident custody). ASN.1/CMS is handled by github.com/digitorus/timestamp (never hand-rolled).

Token verification (VerifyToken) lives here, not in the domain, because RFC-3161 + CMS are not stdlib (unlike the ed25519 attestation in domain/evidence). It proves the token binds the digest and that the token's own CMS signature is intact; it does NOT decide whether the issuing TSA is trusted – that is the verifier's policy.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VerifyToken

func VerifyToken(token ports.TimestampToken, digest []byte) (time.Time, error)

VerifyToken re-parses an opaque RFC-3161 token, confirms it binds digest (its messageImprint == SHA-256(digest)) and that the token's CMS signature is intact, and returns the asserted time. Whether the issuing TSA is trusted is the caller's policy (pin the TSA cert / require an eIDAS-qualified authority).

Types

type Client

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

Client is an RFC-3161 timestamp client bound to one TSA URL.

func NewClient

func NewClient(url string, timeout time.Duration) (*Client, error)

NewClient validates the TSA URL and returns a client. A non-positive timeout uses a default; the timeout bounds the seal-path call so a slow TSA cannot hang it (the vault treats timestamping as best-effort).

func (*Client) Timestamp

func (c *Client) Timestamp(ctx context.Context, digest []byte) (ports.TimestampToken, error)

Timestamp requests an RFC-3161 token over digest (a chain head's bytes). The TSA's messageImprint is SHA-256(digest); the response is verified to bind exactly that digest before it is accepted, and the opaque DER token is base64'd into the result.

Jump to

Keyboard shortcuts

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