GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - git-pkgs/sigstore: sigstore-go wrapper for verifying attestation bundles against the Sigstore TUF trust root

BranchesTags
Open more actions menu

Latest commit

 

History

50 Commits
50 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
testdata
testdata
 
 
.golangci.yml
.golangci.yml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 
sigstore.go
sigstore.go
 
 
sigstore_test.go
sigstore_test.go
 
 
verify_smoke_test.go
verify_smoke_test.go
 
 

Repository files navigation

sigstore

A thin sigstore-go wrapper that validates a sigstore bundle against the live (or cached) Sigstore TUF trust root. Cross-ecosystem by design: handles any (digestAlg, digest) pair, so npm tarball (sha512), GitHub artifact (sha256), PyPI distribution, Maven Central, and Cargo package attestations all use the same code path.

Install

go get github.com/git-pkgs/sigstore

Usage

import (
    "crypto/sha512"

    "github.com/sigstore/sigstore-go/pkg/root"

    "github.com/git-pkgs/sigstore"
)

tr, err := root.FetchTrustedRoot() // or FetchTrustedRootWithOptions for a local cache
if err != nil { return err }

v := sigstore.New(tr)
digest := sha512.Sum512(artifactBytes)
err = v.VerifyBundle(ctx, bundleBytes, "sha512", digest[:])

VerifyBundle returns nil when:

  • the bundle's Fulcio cert chains to the trust root,
  • the Rekor inclusion proof is valid,
  • the DSSE envelope signature matches the cert,
  • the in-toto subject digest matches the supplied (digestAlg, digest).

Use VerifyBundleDetailed when the caller also needs the certificate identity and OIDC issuer, verified hex-encoded Rekor log key ID, URI, and integrated time, in-toto subjects, or predicate data:

result, err := v.VerifyBundleDetailed(ctx, bundleBytes, "sha512", digest[:])

result.Statement contains the exact decoded DSSE payload and result.Predicate contains its raw JSON predicate. These fields are returned only after verification succeeds. The caller is responsible for deciding whether result.CertificateIdentity and result.CertificateIssuer are authorized for its use case.

Pluggable verifier pattern

Consumers typically declare a one-method interface so other verifiers (witness, SBOMit, plain in-toto) can swap in:

type ProvenanceVerifier interface {
    VerifyBundle(ctx context.Context, body []byte, alg string, digest []byte) error
}

*Verifier satisfies this structurally — no shared interface package needed.

Why standalone

sigstore-go is a heavy dependency (TUF, Fulcio, Rekor, x509, protobuf). Carrying it in larger surfaces (CLIs, libraries) is wasteful when consumers only want bundle verification. Importing this package opts in explicitly.

For identity-field extraction without verification, see github.com/git-pkgs/attestation (stdlib-only).

License

MIT.

About

sigstore-go wrapper for verifying attestation bundles against the Sigstore TUF trust root

git-pkgs.dev

Topics

git-pkgsgogolangprovenancesigstoreslsasoftware-supply-chain

Resources

Readme
MIT license

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity
Custom properties

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.