kt

package
v0.0.0-...-02c3ccb Latest Latest
Warning

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

Go to latest
Published: May 22, 2017 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNilProof occurs when the provided GetEntryResponse contains a nil proof.
	ErrNilProof = errors.New("nil proof")

	// Vlog is the verbose logger. By default it outputs to /dev/null.
	Vlog = log.New(ioutil.Discard, "", 0)
)

Functions

This section is empty.

Types

type Verifier

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

Verifier is a client helper library for verifying request and responses.

func New

func New(vrf vrf.PublicKey,
	tree *tv.Verifier,
	sig crypto.PublicKey,
	log client.LogVerifier) *Verifier

New creates a new instance of the client verifier.

func (*Verifier) CreateUpdateEntryRequest

func (v *Verifier) CreateUpdateEntryRequest(
	trusted *trillian.SignedLogRoot, getResp *tpb.GetEntryResponse,
	vrf vrf.PublicKey, userID, appID string, profileData []byte,
	signers []signatures.Signer, authorizedKeys []*tpb.PublicKey) (*tpb.UpdateEntryRequest, error)

CreateUpdateEntryRequest creates UpdateEntryRequest given GetEntryResponse, user ID and a profile.

func (Verifier) VerifyCommitment

func (Verifier) VerifyCommitment(userID, appID string, in *tpb.GetEntryResponse) error

VerifyCommitment verifies that the commitment in `in` is correct for userID.

func (*Verifier) VerifyGetEntryResponse

func (v *Verifier) VerifyGetEntryResponse(ctx context.Context, userID, appID string,
	trusted *trillian.SignedLogRoot, in *tpb.GetEntryResponse) error

VerifyGetEntryResponse verifies GetEntryResponse:

  • Verify commitment.
  • Verify VRF.
  • Verify tree proof.
  • Verify signature.
  • Verify consistency proof from log.Root().
  • Verify inclusion proof.

Jump to

Keyboard shortcuts

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