| Crates.io | sigstore-sign |
| lib.rs | sigstore-sign |
| version | 0.6.0 |
| created_at | 2025-11-27 11:41:27.161621+00 |
| updated_at | 2025-12-17 09:08:00.103891+00 |
| description | Sigstore signature creation |
| homepage | |
| repository | https://github.com/wolfv/sigstore-rust |
| max_upload_size | |
| id | 1953586 |
| size | 100,129 |
Sigstore signature creation for sigstore-rust.
This crate provides high-level APIs for creating Sigstore signatures. It orchestrates the keyless signing flow: OIDC authentication, certificate issuance from Fulcio, signing, transparency log submission to Rekor, and optional timestamping.
use sigstore_sign::{SigningContext, Attestation, AttestationSubject};
use sigstore_oidc::IdentityToken;
use sigstore_types::Sha256Hash;
// Create a signing context for production
let context = SigningContext::production();
// Get an identity token (from OIDC provider)
let token = IdentityToken::new("your-identity-token".to_string());
// Create a signer
let signer = context.signer(token);
// Sign artifact bytes
let artifact = b"hello world";
let bundle = signer.sign(artifact).await?;
// Or sign with a pre-computed digest (for large files)
let digest = Sha256Hash::from_hex("b94d27b9...")?;
let bundle = signer.sign(digest).await?;
// Sign an in-toto attestation (DSSE envelope)
let subject = AttestationSubject::new("artifact.tar.gz", digest);
let attestation = Attestation::new("https://slsa.dev/provenance/v1")
.with_subject(subject)
.with_predicate(serde_json::json!({"key": "value"}));
let bundle = signer.sign_attestation(attestation).await?;
// Write bundle to file
std::fs::write("artifact.sigstore.json", bundle.to_json_pretty()?)?;
use sigstore_sign::SigningContext;
// Production environment
let context = SigningContext::production();
// Staging environment
let context = SigningContext::staging();
sigstore-verify - Verify signatures created by this crateBSD-3-Clause