witness

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: Apache-2.0 Imports: 28 Imported by: 4

README

go-witness

A client library for Witness, written in Go.

Go Reference Go Report Card OpenSSF Best Practices OpenSSF Scorecard FOSSA Status

Status

This library is currently pre-1.0 and therefore the API may be subject to breaking changes.

Features

  • Creation and signing of in-toto attestations
  • Verification of in-toto attestations and associated signatures with:
  • A growing list of attestor types defined under a common interface
  • A selection of attestation sources to search for attestation collections

Documentation

For more detail regarding the library itself, we recommend viewing pkg.go.dev. For the documentation of the witness project, please view the main witness repository.

Requirements

In order to effectively contribute to this library, you will need:

  • A Unix-compatible Operating System
  • GNU Make
  • Go 1.19

Running Tests

This repository uses Go tests for testing. You can run these tests by executing make test.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sign

func Sign(r io.Reader, dataType string, w io.Writer, opts ...dsse.SignOption) error

func Verify

func Verify(ctx context.Context, policyEnvelope dsse.Envelope, policyVerifiers []cryptoutil.Verifier, opts ...VerifyOption) (map[string][]source.VerifiedCollection, error)

Verify verifies a set of attestations against a provided policy. The set of attestations that satisfy the policy will be returned if verifiation is successful.

func VerifySignature

func VerifySignature(r io.Reader, verifiers ...cryptoutil.Verifier) (dsse.Envelope, error)

Types

type RunOption

type RunOption func(ro *runOptions)

func RunWithAttestationOpts

func RunWithAttestationOpts(opts ...attestation.AttestationContextOption) RunOption

func RunWithAttestors

func RunWithAttestors(attestors []attestation.Attestor) RunOption

func RunWithTimestampers

func RunWithTimestampers(ts ...dsse.Timestamper) RunOption

type RunResult

type RunResult struct {
	Collection     attestation.Collection
	SignedEnvelope dsse.Envelope
}

func Run

func Run(stepName string, signer cryptoutil.Signer, opts ...RunOption) (RunResult, error)

type VerifyOption

type VerifyOption func(*verifyOptions)

func VerifyWithCollectionSource

func VerifyWithCollectionSource(source source.Sourcer) VerifyOption

func VerifyWithSubjectDigests

func VerifyWithSubjectDigests(subjectDigests []cryptoutil.DigestSet) VerifyOption

Jump to

Keyboard shortcuts

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