Skip to content

Commit cb7a54b

Browse files
authored
Adding information on sigstore-go (#345)
* initial Go commit. Signed-off-by: hayleycd <[email protected]> * Initial Go entry Signed-off-by: hayleycd <[email protected]> * Clarified cosign vs sigstore-go. Signed-off-by: hayleycd <[email protected]> * Addressing linter comments. Signed-off-by: hayleycd <[email protected]> --------- Signed-off-by: hayleycd <[email protected]>
1 parent 1d0f100 commit cb7a54b

File tree

3 files changed

+87
-1
lines changed

3 files changed

+87
-1
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
type: docs
3+
title: "Go"
4+
description: "Go Language Client"
5+
lead: "Go Language Client"
6+
date: 2024-10-06T08:49:15+00:00
7+
lastmod: 2024-10-06T08:49:15+00:00
8+
draft: false
9+
images: []
10+
weight: 60
11+
---
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
type: docs
3+
category: Go
4+
title: Go Client Overview
5+
weight: 5
6+
---
7+
8+
[`sigstore-go`](https://pkg.go.dev/github.com/sigstore/sigstore-go) is the Go language client library for Sigstore.
9+
10+
`sigstore-go` is intended as a minimal dependency library for signing and verifying. It's not intended to replace [cosign](../../cosign/signing/overview.md), which provides a CLI with many features for interacting with Sigstore. Over time, `cosign` will use `sigstore-go` for verification.
11+
12+
- Friendly API for integrating Go code with Sigstore
13+
- Smaller dependency tree
14+
- Focuses on newly specified data structures in [sigstore/protobuf-specs](https://github.com/sigstore/protobuf-specs)
15+
- Perfect for simple signing and verififcation tasks
16+
17+
`sigstore-go` is currently in beta.
18+
19+
## Features
20+
21+
- Signing and verification of [Sigstore bundles](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto)
22+
- Verification of raw Sigstore signatures
23+
- Signing and verifying with a Timestamp Authority (TSA)
24+
- Online and offline signing and verifying with Rekor (Artifact Transparency Log)
25+
- Structured verification results including certificate metadata
26+
- TUF support
27+
- Verification support for custom [trusted root](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_trustroot.proto)
28+
- Basic CLI
29+
30+
## Installation
31+
32+
### Main CLI installation
33+
34+
`sigstore-go` requires Go 1.21 or greater. The package is tested with Go 1.23.
35+
36+
To compile/install the CLI, clone [`sigstore-go`](https://github.com/sigstore/sigstore-go) and run.
37+
38+
```console
39+
make install
40+
```
41+
42+
Alternatively, you can use `go run cmd/sigstore-go/main.go` to access the CLI, as show in the [example](#cli-example).
43+
44+
## Example
45+
46+
### CLI example
47+
48+
The following is an example of using the sigstore-go CLI to verify a signature.
49+
50+
```console
51+
go run cmd/sigstore-go/main.go \
52+
-artifact-digest 76176ffa33808b54602c7c35de5c6e9a4deb96066dba6533f50ac234f4f1f4c6b3527515dc17c06fbe2860030f410eee69ea20079bd3a2c6f3dcf3b329b10751 \
53+
-artifact-digest-algorithm sha512 \
54+
-expectedIssuer https://token.actions.githubusercontent.com \
55+
-expectedSAN https://github.com/sigstore/sigstore-js/.github/workflows/release.yml@refs/heads/main \
56+
examples/bundle-provenance.json
57+
Verification successful!
58+
{
59+
"version": 20230823,
60+
"statement": {
61+
"_type": "https://in-toto.io/Statement/v0.1",
62+
"predicateType": "https://slsa.dev/provenance/v0.2",
63+
"subject": ...
64+
},
65+
...
66+
}
67+
```
68+
69+
### Additional examples
70+
71+
Additional examples are available in the [project documentation](https://github.com/sigstore/sigstore-go#sigstore-go).
72+
73+
- [Signing example](https://github.com/sigstore/sigstore-go/blob/main/docs/signing.md#examples)
74+
- [Verifying example](https://github.com/sigstore/sigstore-go/blob/main/docs/verification.md#verification-using-sigstore-go)
75+
- [OCI image verifying example](https://github.com/sigstore/sigstore-go/blob/main/docs/oci-image-verification.md#example-of-oci-image-verification-using-sigstore-go)

content/en/language_clients/language_client_overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ Sigstore has clients for the following language ecosystems:
1414
- [Ruby](https://github.com/sigstore/sigstore-ruby#sigstore)
1515
- [JavaScript](https://github.com/sigstore/sigstore-js#sigstore-js---)
1616
- [Java](https://github.com/sigstore/sigstore-java#sigstore-java)
17-
- [Go](https://github.com/sigstore/sigstore-go#sigstore-go)
17+
- [Go](../go/overview)
1818

1919
Language client documentation is hosted in the individual project repositories. Project summaries are currently being added to the main Sigstore documentation.

0 commit comments

Comments
 (0)