sigstore_sign/lib.rs
1//! Sigstore signature creation
2//!
3//! This crate provides the main entry point for signing artifacts with Sigstore.
4//!
5//! # Example
6//!
7//! ```no_run
8//! use sigstore_sign::{SigningContext, SigningConfig};
9//! use sigstore_oidc::IdentityToken;
10//!
11//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
12//! let context = SigningContext::production();
13//! let token = IdentityToken::new("your-identity-token".to_string());
14//! let signer = context.signer(token);
15//!
16//! let artifact = b"hello world";
17//! let bundle = signer.sign(artifact).await?;
18//!
19//! // Write bundle to file
20//! std::fs::write("artifact.sigstore.json", bundle.to_json_pretty()?)?;
21//! # Ok(())
22//! # }
23//! ```
24
25pub mod error;
26mod sign;
27
28// Re-export core crates that users need
29pub use sigstore_bundle as bundle;
30pub use sigstore_crypto as crypto;
31pub use sigstore_fulcio as fulcio;
32pub use sigstore_oidc as oidc;
33pub use sigstore_rekor as rekor;
34pub use sigstore_tsa as tsa;
35pub use sigstore_types as types;
36
37pub use error::{Error, Result};
38pub use sign::{
39 sign_context, Attestation, AttestationSubject, Signer, SigningConfig, SigningContext,
40};