sigstore-verify
Sigstore signature verification for sigstore-rust.
Overview
This crate provides high-level APIs for verifying Sigstore signatures. It handles the complete verification flow: bundle parsing, certificate chain validation, signature verification, transparency log verification, and identity policy enforcement.
Features
- Bundle verification: Verify standard Sigstore bundles
- Certificate validation: X.509 chain validation against Fulcio CA
- Transparency log verification: Checkpoint signatures, inclusion proofs, SETs
- Timestamp verification: RFC 3161 timestamp validation
- Identity policies: Verify signer identity claims (issuer, subject, etc.)
Verification Steps
- Parse and validate bundle structure
- Verify certificate chain against trusted root
- Verify signature over artifact
- Verify transparency log entry (checkpoint, inclusion proof, or SET)
- Verify timestamps if present
- Check identity against policy (optional)
Offline verification
The default sigstore-verify dependency tree has no HTTP client or Tokio runtime.
Verification always uses the supplied trusted root and never fetches artifacts
or keys. Enable tuf plus rustls (default) or native-tls when the application
also needs network trust-root refreshes.
Verifier construction
Verifier::new(&root)? prepares Rekor/CT keyrings and Fulcio trust anchors before
reading artifacts. Invalid certificates, keys, duplicate log IDs and reversed
validity windows are errors at construction. Unsupported configured keys must be
removed explicitly rather than silently ignored. Key/authority activation times
are still checked when verifying, so long-lived verifiers do not freeze time.
Verification results
VerificationResult is created only by successful verification and exposes
read-only accessors. identity() and issuer() are certificate claims;
certificate_verified(), sct_verified(), tlog_verified() and
identity_policy_checked() describe what was actually checked.
verified_timestamps() excludes unsigned time hints. Relaxed policies must not
be treated as equivalent to full certificate and log verification.
Authorization
VerificationPolicy has no default. Prefer VerificationPolicy::new(identity, issuer)
to authorize the expected signer. any_identity() is an explicit opt-in to
cryptographic verification without signer authorization. The example CLI likewise
requires an identity/issuer restriction or --allow-any-identity.
Usage
use ;
use ;
use ;
let bundle: Bundle = from_str?;
let policy = any_identity;
// Actively choose the Sigstore instance and fetch its root through TUF.
let root = from_tuf.await?;
// Verify with raw artifact bytes
let artifact_bytes = b"hello world";
let result = verify?;
// Or verify with pre-computed SHA-256 digest (useful for large files)
let digest = from_hex?;
let result = verify?;
// Or use a Verifier directly; it also offers the same inputs
let verifier = new?;
let result = verifier.verify?;
// Stream a large artifact in constant memory
let file = open?;
let result = verifier.verify_reader?;
// Runtime-independent futures_io::AsyncRead is also supported
let result = verifier.verify_async_reader.await?;
// Managed-key bundles use the `verify_with_key*` family with the same
// three input shapes: `verify_with_key`, `verify_with_key_reader`,
// `verify_with_key_async_reader`.
For Tokio readers, enable tokio-util's compat feature and use
tokio_util::compat::TokioAsyncReadCompatExt::compat() on the file or stream.
Reader verification rejects message-signature schemes that require the original
bytes (such as Ed25519) before consuming input; use the byte API for those schemes.
For GitHub artifact attestations, choose GitHub's Sigstore instance explicitly and use the GitHub verification profile:
use ;
use ;
use ;
let bundle: Bundle = from_str?;
let artifact_digest = from_hex?;
// Fetch GitHub's trusted root over TUF (now supported via the `sigstore-tuf`
// client), or use the embedded copy below for an offline path.
// let root = TrustedRoot::from_tuf(sigstore_trust_root::TufConfig::github()).await?;
let root = from_embedded?;
let policy = any_identity.skip_tlog_unsafe.skip_sct;
let result = verify?;
Verification Policies
use VerificationPolicy;
// Default policy (verify tlog, timestamps, and certificate chain)
let policy = any_identity;
// Require specific identity and issuer
let policy = any_identity
.require_identity
.require_issuer;
// Skip certain verifications (for testing only)
let policy = any_identity
.skip_tlog_unsafe
.skip_certificate_chain;
Related Crates
sigstore-sign- Create signatures to verify with this crate
License
Apache-2.0