Documentation ¶
Overview ¶
Package client is a CT log client implementation and contains types and code for interacting with RFC6962-compliant CT Log instances. See http://tools.ietf.org/html/rfc6962 for details
Index ¶
- Constants
- type GetEntriesItem
- type LogClient
- func (c *LogClient) AddChain(ctx context.Context, chain [][]byte) (*ct.SignedCertificateTimestamp, error)
- func (c *LogClient) GetAuditProof(ctx context.Context, hash ct.MerkleTreeNode, treeSize uint64) (ct.AuditPath, uint64, error)
- func (c *LogClient) GetConsistencyProof(ctx context.Context, first, second int64) (ct.ConsistencyProof, error)
- func (c *LogClient) GetEntries(ctx context.Context, start, end int64) ([]ct.LogEntry, error)
- func (c *LogClient) GetRawEntries(ctx context.Context, start, end uint64) ([]GetEntriesItem, error)
- func (c *LogClient) GetSTH(ctx context.Context) (sth *ct.SignedTreeHead, err error)
Constants ¶
const ( GetSTHPath = "/ct/v1/get-sth" GetEntriesPath = "/ct/v1/get-entries" GetSTHConsistencyPath = "/ct/v1/get-sth-consistency" GetProofByHashPath = "/ct/v1/get-proof-by-hash" AddChainPath = "/ct/v1/add-chain" )
URI paths for CT Log endpoints
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GetEntriesItem ¶ added in v0.15.0
type LogClient ¶
type LogClient struct {
// contains filtered or unexported fields
}
LogClient represents a client for a given CT Log instance
func New ¶
New constructs a new LogClient instance. |uri| is the base URI of the CT log instance to interact with, e.g. http://ct.googleapis.com/pilot
func NewWithVerifier ¶ added in v0.15.0
func NewWithVerifier(uri string, verifier *ct.SignatureVerifier) *LogClient
func (*LogClient) AddChain ¶
func (*LogClient) GetAuditProof ¶
func (c *LogClient) GetAuditProof(ctx context.Context, hash ct.MerkleTreeNode, treeSize uint64) (ct.AuditPath, uint64, error)
GetAuditProof retrieves a Merkle Audit Proof (aka Inclusion Proof) for the given |hash| based on the STH at |treeSize| from the log. Returns a slice of MerkleTreeNodes and the index of the leaf.
func (*LogClient) GetConsistencyProof ¶
func (c *LogClient) GetConsistencyProof(ctx context.Context, first, second int64) (ct.ConsistencyProof, error)
GetConsistencyProof retrieves a Merkle Consistency Proof between two STHs (|first| and |second|) from the log. Returns a slice of MerkleTreeNodes (a ct.ConsistencyProof) or a non-nil error.
func (*LogClient) GetEntries ¶
GetEntries attempts to retrieve the entries in the sequence [|start|, |end|] from the CT log server. (see section 4.6.) Returns a slice of LeafInputs or a non-nil error.
func (*LogClient) GetRawEntries ¶ added in v0.15.0
Retrieve the entries in the sequence [start, end] from the CT log server. If error is nil, at least one entry is returned, and no excess entries are returned. Fewer entries than requested may be returned.