validate

package
v0.0.0-...-dac1202 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByLamportTime

type ByLamportTime []*versionInfo

func (ByLamportTime) Len

func (a ByLamportTime) Len() int

func (ByLamportTime) Less

func (a ByLamportTime) Less(i, j int) bool

func (ByLamportTime) Swap

func (a ByLamportTime) Swap(i, j int)

type Validator

type Validator struct {

	// FirstKey is the key used to sign the first commit.
	FirstKey *identity.Key
	// contains filtered or unexported fields
}

func NewValidator

func NewValidator(repo repository.ClockedRepo, backend *cache.RepoCache) (*Validator, error)

NewValidator creates a validator for the current identities snapshot. If identities are changed a new Validator instance should be used.

The returned instance can be used to verify multiple git refs from the main repository against the keychain built from the identities snapshot loaded initially.

func (*Validator) KeyCommitHash

func (v *Validator) KeyCommitHash(keyId uint64) string

KeyCommitHash reports the hash of the commit associated with the Identity Version introducing the key using the specified keyId, if any.

func (*Validator) ValidateCommit

func (v *Validator) ValidateCommit(ref string) (*packet.PublicKey, error)

ValidateCommit checks the commit signature along with the key's expire time. Returns the pubkey used to sign the specified commit, or an error.

func (*Validator) ValidateExternalCommit

func (v *Validator) ValidateExternalCommit(repoPath string, ref string) (*packet.PublicKey, error)

ValidateExternalCommit checks the commit (located in another repository) signature along with the key's expire time. Returns the pubkey used to sign the specified commit, or an error.

Jump to

Keyboard shortcuts

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