Skip to content

Commit 7cc85ad

Browse files
authored
Merge pull request #772 from sigstore/pre-ga-docs
update readmes
2 parents 9205a93 + 95db097 commit 7cc85ad

File tree

3 files changed

+42
-26
lines changed

3 files changed

+42
-26
lines changed

README.md

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,28 @@
55
# sigstore-java
66
A sigstore java client for interacting with sigstore infrastructure
77

8-
⚠️ This project is not ready for general-purpose use! ⚠️
8+
## Requirements
9+
* Java 11 (https://github.com/sigstore/sigstore-java requires Java 11)
10+
This project requires a minimum of Java 11
911

10-
This project requires a minimum of Java 11 and is current in pre-release,
11-
apis and dependencies are likely to change
12-
13-
You can files issues directly on this project or if you have any questions
14-
message us on the [sigstore#java](https://sigstore.slack.com/archives/C03239XUL92) slack channel
12+
You can file [issues directly](https://github.com/sigstore/sigstore-java/issues) on this project or
13+
if you have any questions message us on the [sigstore#java](https://sigstore.slack.com/archives/C03239XUL92)
14+
slack channel
1515

1616
## Usage
1717

18+
### Build plugins
19+
20+
For use directly with your java build. See [maven](https://github.com/sigstore/sigstore-java/tree/main/sigstore-maven-plugin) or [gradle](https://github.com/sigstore/sigstore-java/tree/main/sigstore-gradle)
21+
build plugin specifics.
22+
1823
### Keyless Signing And Verification
1924

2025
#### Signing
2126
```java
2227
Path testArtifact = Paths.get("path/to/my/file.jar")
2328

29+
// sign using the sigstore public instance
2430
var signer = KeylessSigner.builder().sigstorePublicDefaults().build();
2531
Bundle result = signer.signFile(testArtifact);
2632

@@ -30,29 +36,29 @@ String bundleJson = result.toJson();
3036

3137
#### Verification
3238

33-
##### Read bundle
39+
##### Get artifact and bundle
3440
```java
35-
Path bundleFile = // java.nio.Path to a .sigstore.json signature bundle file
36-
Bundle bundle = Bundle.from(Files.newBufferedReader(bundleFile, StandardCharsets.UTF_8));
41+
Path artifact = Paths.get("path/to/my-artifact");
42+
43+
// import a json formatted sigstore bundle
44+
Path bundleFile = Paths.get("path/to/my-artifact.sigstore.json");
45+
Bundle bundle = Bundle.from(bundleFile, StandardCharsets.UTF_8);
3746
```
3847

3948
##### Configure verification options
4049
```java
4150
// add certificate policy to verify the identity of the signer
42-
VerificationOptions verificationOptions =
43-
VerificationOptions.builder()
44-
.addCertificateIdentities(
45-
CertificateIdentity.builder()
46-
.issuer("https://accounts.example.com"))
47-
.subjectAlternativeName("[email protected]")
48-
.build())
49-
.build();
51+
VerificationOptions options = VerificationOptions.builder().addCertificateMatchers(
52+
CertificateMatcher.fulcio()
53+
.subjectAlternativeName(StringMatcher.string("[email protected]"))
54+
.issuer(StringMatcher.string("https://accounts.example.com"))
55+
.build());
5056
```
5157

5258
##### Do verification
5359
```java
54-
Path artifact = // java.nio.Path to artifact file
5560
try {
61+
// verify using the sigstore public instance
5662
var verifier = new KeylessVerifier.builder().sigstorePublicDefaults().build();
5763
verifier.verify(artifact, bundle, verificationOptions);
5864
// verification passed!
@@ -67,7 +73,7 @@ The public stable API is limited to `dev.sigstore.KeylessSigner`(https://javadoc
6773

6874
You can browse Javadoc at https://javadoc.io/doc/dev.sigstore/sigstore-java.
6975

70-
To build javadoc from the sources, use the following command:
76+
To build and view javadoc from the sources, use the following command:
7177

7278
```sh
7379
$ ./gradlew javadoc

sigstore-gradle/README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
## sigstore-gradle
1+
[![Gradle Plugin Portal](https://img.shields.io/maven-metadata/v/https/plugins.gradle.org/m2/dev/sigstore/sigstore-gradle-sign-plugin/maven-metadata.xml.svg?color&label=gradle%20plugin%20portal)](https://plugins.gradle.org/plugin/dev.sigstore.sign/)
2+
3+
# sigstore-gradle
24

35
A Gradle plugin for signing artifacts with Sigstore.
46

5-
`dev.sigstore.sign` is available on the gradle plugin portal.
67
Signature format uses [Sigstore bundle](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto) JSON as the output format.
78

89
## Requirements
@@ -18,11 +19,14 @@ plugins {
1819
id("dev.sigstore.sign")
1920
}
2021

21-
// It would automatically sign all Maven publications
22-
// By default, it would use GitHub Actions OIDC when available,
23-
// and it would resort to Web Browser OIDC otherwise.
22+
// Automatically sign all Maven publications, using GitHub Actions OIDC when available,
23+
// and browser based OIDC otherwise.
2424
```
2525

26+
### Outputs
27+
28+
For each file to be published an associated `<filename>.sigstore.json` signature file will be generated
29+
2630
### GitHub Actions OIDC support
2731

2832
In order for the required environment variables to be available, the workflow requires the following permissions:
@@ -35,6 +39,7 @@ permissions:
3539
3640
See [GitHub documentation](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-cloud-providers#adding-permissions-settings) for details.
3741
42+
3843
## Full configuration
3944
4045
```kotlin

sigstore-maven-plugin/README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
# sigstore-maven-plugin
1+
[![Maven Central](https://img.shields.io/maven-central/v/dev.sigstore/sigstore-maven-plugin.svg?color&label=maven%20central)](https://central.sonatype.com/artifact/dev.sigstore/sigstore-maven-plugin)
22

3-
[![Maven Central](https://img.shields.io/maven-central/v/dev.sigstore/sigstore-maven-plugin.svg?label=Maven%20Central)](https://central.sonatype.com/artifact/dev.sigstore/sigstore-maven-plugin)
3+
# sigstore-maven-plugin
44

55
A Maven plugin for signing artifacts with Sigstore
66

7+
Signature format uses [Sigstore bundle](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto) JSON as the output format.
78

89
## Requirements
910

@@ -27,6 +28,10 @@ A Maven plugin for signing artifacts with Sigstore
2728
</plugin>
2829
```
2930

31+
### Outputs
32+
33+
For each file to be published an associated `<filename>.sigstore.json` signature file will be generated
34+
3035
### GitHub Actions OIDC support
3136

3237
In order for the required environment variables to be available, the workflow requires the following permissions:

0 commit comments

Comments
 (0)