Skip to content

Commit

Permalink
Simplify cosign verify-bundle example
Browse files Browse the repository at this point in the history
* Remove unneeded env var
* Use the README as the blob
* Avoid running sigstore/cosign to verify: the sigstore-rs example
  should be enough
  • Loading branch information
jku committed Oct 15, 2024
1 parent e536360 commit 1c4d893
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 17 deletions.
11 changes: 3 additions & 8 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 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

0 comments on commit 1c4d893

Please sign in to comment.