policy

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: BSD-2-Clause Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// Predefined name representing an empty group. Using "quorum
	// none" defines a policy that doesn't require any cosignatures.
	ConfigNone = "none"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Entity

type Entity struct {
	PublicKey crypto.PublicKey
	URL       string
}

type Policy

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

func NewKofNPolicy

func NewKofNPolicy(logs, witnesses []crypto.PublicKey, k int) (*Policy, error)

func ParseConfig

func ParseConfig(file io.Reader) (*Policy, error)

func ReadPolicyFile

func ReadPolicyFile(name string) (*Policy, error)

func (*Policy) GetLogsWithUrl

func (p *Policy) GetLogsWithUrl() []Entity

Returns all logs with url specified, in randomized order.

func (*Policy) GetWitnessesWithUrl

func (p *Policy) GetWitnessesWithUrl() []Entity

Returns all witnesses with url specified, in randomized order.

func (*Policy) VerifyCosignedTreeHead

func (p *Policy) VerifyCosignedTreeHead(logKeyHash *crypto.Hash,
	cth *types.CosignedTreeHead) error

type Quorum

type Quorum interface {
	IsQuorum(map[crypto.Hash]struct{}) bool
}

The method gets a set of witnesses for which a cosignature was verified, and returns whether or not they are sufficient.

Jump to

Keyboard shortcuts

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