Documentation ¶
Index ¶
- Constants
- func AppendTileLeaf(t []byte, e *LogEntry) []byte
- func FormatCheckpoint(c Checkpoint) string
- func MarshalExtensions(e Extensions) ([]byte, error)
- func NewRFC6962Verifier(name string, key crypto.PublicKey) (note.Verifier, error)
- func RFC6962SignatureTimestamp(sig note.Signature) (int64, error)
- func TilePath(t tlog.Tile) string
- type Checkpoint
- type Extensions
- type LogEntry
Constants ¶
const TileHeight = 8
const TileWidth = 1 << TileHeight
Variables ¶
This section is empty.
Functions ¶
func AppendTileLeaf ¶
AppendTileLeaf appends a LogEntry to a data tile.
func FormatCheckpoint ¶
func FormatCheckpoint(c Checkpoint) string
func MarshalExtensions ¶
func MarshalExtensions(e Extensions) ([]byte, error)
func NewRFC6962Verifier ¶
NewRFC6962Verifier constructs a new note.Verifier that verifies a RFC 6962 TreeHeadSignature formatted according to c2sp.org/sunlight.
Types ¶
type Checkpoint ¶
type Checkpoint struct { Origin string tlog.Tree // Extension is empty or a sequence of non-empty lines, // each terminated by a newline character. Extension string }
A Checkpoint is a tree head to be formatted according to c2sp.org/checkpoint.
A checkpoint looks like this:
example.com/origin 923748 nND/nri/U0xuHUrYSy0HtMeal2vzD9V4k/BO79C+QeI=
It can be followed by extra extension lines.
func ParseCheckpoint ¶
func ParseCheckpoint(text string) (Checkpoint, error)
type Extensions ¶
type Extensions struct {
LeafIndex int64
}
Extensions is the CTExtensions field of SignedCertificateTimestamp and TimestampedEntry, according to c2sp.org/sunlight.
func ParseExtensions ¶
func ParseExtensions(extensions []byte) (Extensions, error)
ParseExtensions parse a CTExtensions field, ignoring unknown extensions. It is an error if the leaf_index extension is missing.
type LogEntry ¶
type LogEntry struct { // Certificate is either the TimestampedEntry.signed_entry, or the // PreCert.tbs_certificate for Precertificates. // It must be at most 2^24-1 bytes long. Certificate []byte // IsPrecert is true if LogEntryType is precert_entry. Otherwise, the // following three fields are zero and ignored. IsPrecert bool // IssuerKeyHash is the PreCert.issuer_key_hash. IssuerKeyHash [32]byte // ChainFingerprints are the SHA-256 hashes of the certificates in the // X509ChainEntry.certificate_chain or // PrecertChainEntry.precertificate_chain. ChainFingerprints [][32]byte // PreCertificate is the PrecertChainEntry.pre_certificate. // It must be at most 2^24-1 bytes long. PreCertificate []byte // LeafIndex is the zero-based index of the leaf in the log. // It must be between 0 and 2^40-1. LeafIndex int64 // Timestamp is the TimestampedEntry.timestamp. Timestamp int64 }
func ReadTileLeaf ¶
ReadTileLeaf reads a LogEntry from a data tile, and returns the remaining data in the tile.
func (*LogEntry) MerkleTreeLeaf ¶
MerkleTreeLeaf returns a RFC 6962 MerkleTreeLeaf.