Skip to content

Commit

Permalink
Require a payload to be provided with a signature (sigstore#84)
Browse files Browse the repository at this point in the history
* Update for the added --output-payload option to (cosign sign)

Signed-off-by: Miloslav Trmač <[email protected]>

* Include the required --payload option to (cosign attach signature)

Signed-off-by: Miloslav Trmač <[email protected]>

---------

Signed-off-by: Miloslav Trmač <[email protected]>
  • Loading branch information
mtrmac authored Mar 11, 2023
1 parent 88aae6d commit 9af20fb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions content/en/cosign/sign.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,10 @@ The following checks were performed on each of these signatures:

## Sign but skip upload (to store somewhere else)

The upload is skipped by using the `--upload=false` flag (default true). To capture the output use the `--output-signature FILE` and/or `--output-certificate FILE` flags.
The upload is skipped by using the `--upload=false` flag (default true). To capture the output use the `--output-signature FILE`, `--output-payload FILE`, and/or `--output-certificate FILE` flags.

```shell
$ cosign sign --key key.pem --upload=false --output-signature demo.sig --output-certificate demo.crt user/demo
$ cosign sign --key key.pem --upload=false --output-signature demo.sig --output-payload demo.payload --output-certificate demo.crt user/demo
```

## Generate the signature payload (to sign with another tool)
Expand All @@ -182,21 +182,21 @@ The signature is passed via the `--signature` flag.
It can be a file:

```shell
$ cosign attach signature --signature file.sig user/demo
$ cosign attach signature --signature file.sig --payload payload.json user/demo
Pushing signature to: user/demo:sha256-87ef60f558bad79beea6425a3b28989f01dd417164150ab3baab98dcbf04def8.sig
```

The base64-encoded signature:

```shell
$ cosign attach signature --signature Qr883oPOj0dj82PZ0d9mQ2lrdM0lbyLSXUkjt6ejrxtHxwe7bU6Gr27Sysgk1jagf1htO/gvkkg71oJiwWryCQ== user/demo
$ cosign attach signature --signature Qr883oPOj0dj82PZ0d9mQ2lrdM0lbyLSXUkjt6ejrxtHxwe7bU6Gr27Sysgk1jagf1htO/gvkkg71oJiwWryCQ== --payload payload.json user/demo
Pushing signature to: user/demo:sha256-87ef60f558bad79beea6425a3b28989f01dd417164150ab3baab98dcbf04def.sig
```

Or, `-` for `stdin` for chaining from other commands:

```shell
$ cosign generate user/demo | openssl... | cosign attach signature --signature -- user/demo
$ | openssl... | cosign attach signature --signature - --payload … user/demo
Pushing signature to: user/demo:sha256-87ef60f558bad79beea6425a3b28989f01dd417164150ab3baab98dcbf04def.sig
```

Expand Down

0 comments on commit 9af20fb

Please sign in to comment.