Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples: Add a minimal example of bundle sign/verify #410

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jku
Copy link
Member

@jku jku commented Oct 17, 2024

Summary

Add example of sigstore::bundle use to make it more visible that sigstore-rs does make it easy to use the new bundle format (as well as to automatically update the trust root). More specifically the example uses

  • sigstore::bundle to sign and verify
  • sigstore::oauth to get a signing token

Fixes #406

Release Note

  • examples: Added example of sigstore::bundle use

-->

Documentation

See included README.md and --help output

Comment on lines 95 to 97
println!(
"Created signature bundle {} with identity {}",
&bundle_path, email
Copy link
Member Author

@jku jku Oct 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd love to print something that would contain the correct verification command:

Signed README.md. To verify use
    $ cargo run --example bundle verify --identity name@example.com --issuer https://github.com/login/oauth README.md

But that's not currently possible since the issuer does not seem to be exposed (#409).

This uses
* sigstore::bundle to sign and verify
* sigstore::oauth to get a signing token

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
println!("Failed to create signature bundle {}: {}", bundle_path, e);
std::process::exit(1);
});
let token = authorize();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should maybe add a println! here that hints that a browser will be opened for the auth...

examples/bundle/main.rs Outdated Show resolved Hide resolved
Don't use display() when creating a new path, instead use
PathBuf.set_file_name()

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

examples/docs for sigstore::bundle
1 participant