entry

package
v0.0.0-...-1e3cd99 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package entry implements a simple replacement strategy as a mapper.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromLeafValue

func FromLeafValue(value []byte) (*tpb.Entry, error)

FromLeafValue takes a trillian.MapLeaf.LeafValue and returns and instantiated Entry or nil if the passes LeafValue was nil.

Types

type Mutation

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

Mutation provides APIs for manipulating entries.

func NewMutation

func NewMutation(oldValue, index []byte, userID, appID string) (*Mutation, error)

NewMutation creates a mutation object from a previous value which can be modified. To create a new value: - Create a new mutation for a user starting with the previous value with NewMutation. - Change the value with SetCommitment and ReplaceAuthorizedKeys. - Finalize the changes and create the mutation with SerializeAndSign.

func (*Mutation) ReplaceAuthorizedKeys

func (m *Mutation) ReplaceAuthorizedKeys(pubkeys []*tpb.PublicKey) error

ReplaceAuthorizedKeys sets authorized keys to pubkeys. pubkeys must contain at least one key.

func (*Mutation) SerializeAndSign

func (m *Mutation) SerializeAndSign(signers []signatures.Signer) (*tpb.UpdateEntryRequest, error)

SerializeAndSign produces the mutation.

func (*Mutation) SetCommitment

func (m *Mutation) SetCommitment(data []byte) error

SetCommitment updates entry to be a commitment to data.

type Mutator

type Mutator struct{}

Mutator defines mutations to simply replace the current map value with the contents of the mutation.

func New

func New() *Mutator

New creates a new entry mutator.

func (*Mutator) Mutate

func (*Mutator) Mutate(oldValue, update proto.Message) ([]byte, error)

Mutate verifies that this is a valid mutation for this item and applies mutation to value.

Jump to

Keyboard shortcuts

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