Skip to content

Commit

Permalink
doc: update CLI help doc for notation sign and verify in RC.1 (notary…
Browse files Browse the repository at this point in the history
…project#454)

fix notaryproject#383

Signed-off-by: Feynman Zhou <[email protected]>
  • Loading branch information
FeynmanZhou authored Dec 2, 2022
1 parent a6dbab8 commit a6e6fa0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
19 changes: 11 additions & 8 deletions cmd/notation/sign.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,20 @@ func signCommand(opts *signOpts) *cobra.Command {
Prerequisite: a signing key needs to be configured using the command "notation key".
Example - Sign a container image using the default signing key, with the default JWS envelope:
notation sign <registry>/<repository>:<tag>
Example - Sign an OCI artifact using the default signing key, with the default JWS envelope:
notation sign <registry>/<repository>@<digest>
Example - Sign a container image using the default signing key, with the COSE envelope:
notation sign --signature-format cose <registry>/<repository>:<tag>
Example - Sign an OCI artifact using the default signing key, with the COSE envelope:
notation sign --signature-format cose <registry>/<repository>@<digest>
Example - Sign a container image using the specified key name
notation sign --key <key_name> <registry>/<repository>:<tag>
Example - Sign an OCI artifact using a specified key
notation sign --key <key_name> <registry>/<repository>@<digest>
Example - Sign a container image using the image digest
notation sign <registry>/<repository>@<digest>
Example - Sign an OCI artifact identified by a tag (Notation will resolve tag to digest)
notation sign <registry>/<repository>:<tag>
Example - Sign an OCI artifact stored in a registry and specify the signature expiry duration, for example 24 hours
notation sign --expiry 24h <registry>/<repository>@<digest>
`,
Args: func(cmd *cobra.Command, args []string) error {
if len(args) == 0 {
Expand Down
15 changes: 12 additions & 3 deletions cmd/notation/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,18 @@ func verifyCommand(opts *verifyOpts) *cobra.Command {
opts = &verifyOpts{}
}
command := &cobra.Command{
Use: "verify [flags] <reference>",
Short: "Verify Artifacts",
Long: "Verify signatures associated with the artifact.",
Use: "verify [reference]",
Short: "Verify OCI artifacts",
Long: `Verify OCI artifacts
Prerequisite: added a certificate into trust store and created a trust policy.
Example - Verify a signature on an OCI artifact identified by a digest:
notation verify <registry>/<repository>@<digest>
Example - Verify a signature on an OCI artifact identified by a tag (Notation will resolve tag to digest):
notation verify <registry>/<repository>:<tag>
`,
Args: func(cmd *cobra.Command, args []string) error {
if len(args) == 0 {
return errors.New("missing reference")
Expand Down

0 comments on commit a6e6fa0

Please sign in to comment.