Documentation
¶
Index ¶
- func VerifyConsistencyProofV1(proof, first, second *types.StItem) error
- func VerifyInclusionProofV1(proof, sth *types.StItem, leafHash []byte) error
- func VerifySignedTreeHeadV1(namespace *types.Namespace, sth *types.StItem) error
- type Client
- func (c *Client) AddEntry(ctx context.Context, data *types.ChecksumV1) ([]byte, error)
- func (c *Client) GetConsistencyProof(ctx context.Context, sth1, sth2 *types.StItem) (*types.StItem, error)
- func (c *Client) GetEntries(ctx context.Context, start, end uint64) ([]*types.StItem, error)
- func (c *Client) GetLatestSth(ctx context.Context) (*types.StItem, error)
- func (c *Client) GetProofByHash(ctx context.Context, leafHash []byte, sth *types.StItem) (*types.StItem, error)
- type Descriptor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func VerifyInclusionProofV1 ¶
Types ¶
type Client ¶
type Client struct {
HttpClient *http.Client
Signer crypto.Signer // client's private identity
Namespace *types.Namespace // client's public identity
Log *Descriptor // log's public identity
}
Client is a log client
func NewClientFromFlags ¶
func (*Client) AddEntry ¶
AddEntry signs and submits a checksum_v1 entry to the log. Outputs the resulting leaf-hash on success.
func (*Client) GetConsistencyProof ¶
func (c *Client) GetConsistencyProof(ctx context.Context, sth1, sth2 *types.StItem) (*types.StItem, error)
GetConsistencyProof fetches and verifies a consistency proof betweeen two STHs. Outputs the resulting proof.
func (*Client) GetEntries ¶
GetEntries fetches a range of entries from the log, verifying that they are of type signed_checksum_v1 but nothing more than that. Outputs the resulting range that may be truncated by the log if [start,end] is too large.
func (*Client) GetLatestSth ¶
GetLatestSth fetches and verifies the signature of the most recent STH. Outputs the resulting STH.
type Descriptor ¶
type Descriptor struct {
Namespace *types.Namespace // log identifier is a namespace
Url string // log url, e.g., http://example.com/st/v1
}
Descriptor is a log descriptor
func NewDescriptorFromFlags ¶
func NewDescriptorFromFlags() (*Descriptor, error)
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
add-entry
command
|
|
|
get-consistency-proof
command
|
|
|
get-entries
command
|
|
|
get-proof-by-hash
command
|
|
|
get-sth
command
|
Click to show internal directories.
Click to hide internal directories.