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

Simplify cosign verify-bundle example #408

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions examples/cosign/verify-bundle/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
This example shows how to verify a blob, using a bundle that was created by the
`cosign sign-blob` command.

### Create the artifact to be signed.
```console
cd examples/cosign/verify-bundle
echo something > artifact.txt
### Sign README.md file using cosign
```

### Sign the artifact.txt file using cosign
```
cosign sign-blob --bundle=artifact.bundle artifact.txt
cd examples/cosign/verify-bundle
cosign sign-blob --bundle=artifact.bundle README.md
```

### Verify using sigstore-rs:
```console
cargo run --example verify-bundle -- \
--rekor-pub-key ~/.sigstore/root/targets/rekor.pub \
--bundle artifact.bundle \
artifact.txt
README.md
```
12 changes: 3 additions & 9 deletions examples/cosign/verify-bundle/run.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
BLOB="artifact.txt"
BLOB="README.md"
BUNDLE="artifact.bundle"

echo -e "\nGenerate the blob to be signed"
echo something > $BLOB

echo -e "\nSign the artifact.txt file using sign-blob"
COSIGN_EXPERIMENTAL=1 cosign sign-blob --bundle=$BUNDLE $BLOB

echo -e "\nVerify using cosign. TODO: remove this later"
cosign verify-blob --bundle=$BUNDLE $BLOB
echo -e "\nSign README.md file using sign-blob"
cosign sign-blob --bundle=$BUNDLE $BLOB

echo -e "\nRun examples/cosign/verify-bundle"
cargo run --example verify-bundle -- \
Expand Down
Loading