staticct

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IssuersPrefix      = "issuer/"
	IssuersContentType = "application/pkix-cert"
)

Variables

This section is empty.

Functions

func ExtractTimestampFromBundle

func ExtractTimestampFromBundle(ebRaw []byte, N uint64) (uint64, error)

ExtractTimestampFromBundle extracts the timestamp from the Nth entry in the provided serialised entry bundle.

This implementation attempts to avoid any unecessary allocation or parsing other than whatever is necessary to skip over uninteresting bytes to find the requested ExtractTimestampFromBundle.

func ParseCTExtensions

func ParseCTExtensions(ext string) (uint64, error)

parseCTExtensions parses CTExtensions into an index. Code is inspired by https://github.com/FiloSottile/sunlight/blob/main/tile.go.

func UnmarshalTimestamp

func UnmarshalTimestamp(raw []byte) (uint64, error)

UnmarshalText implements encoding/TextUnmarshaler and reads EntryBundles which are encoded using the Static CT API spec.

Types

type Entry

type Entry struct {
	Timestamp uint64
	IsPrecert bool
	// Certificate holds different things depending on whether the entry represents a Certificate or a Precertificate submission:
	//   - IsPrecert == false: the bytes here are the x509 certificate submitted for logging.
	//   - IsPrecert == true: the bytes here are the TBS certificate extracted from the submitted precert.
	Certificate []byte
	// Precertificate holds the precertificate to be logged, only used when IsPrecert is true.
	Precertificate    []byte
	IssuerKeyHash     []byte
	RawFingerprints   string
	FingerprintsChain [][32]byte
	RawExtensions     string
	LeafIndex         uint64
}

Entry represents a CT log entry.

func (*Entry) UnmarshalText

func (t *Entry) UnmarshalText(raw []byte) error

UnmarshalText implements encoding/TextUnmarshaler and reads EntryBundles which are encoded using the Static CT API spec.

type EntryBundle

type EntryBundle struct {
	// Entries stores the leaf entries of the log, in order.
	Entries [][]byte
}

EntryBundle represents a sequence of entries in the log. These entries correspond to a leaf tile in the hash tree.

func (*EntryBundle) UnmarshalText

func (t *EntryBundle) UnmarshalText(raw []byte) error

UnmarshalText implements encoding/TextUnmarshaler and reads EntryBundles which are encoded using the Static CT API spec. TODO(phbnf): we can probably parse every individual leaf directly, since most callers of this method tend to do so.

Jump to

Keyboard shortcuts

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