Skip to content

Commit

Permalink
Merge pull request #408 from jku/polish-cosign-verify-bundle-example
Browse files Browse the repository at this point in the history
Simplify cosign verify-bundle example
  • Loading branch information
viccuad authored Oct 21, 2024
2 parents 65c6c00 + bb3f82f commit 5345d1d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 18 deletions.
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

0 comments on commit 5345d1d

Please sign in to comment.