Skip to content

Commit e29fb23

Browse files
committed
Update after 0.9.0
Signed-off-by: Appu Goundan <[email protected]>
1 parent 4a4c137 commit e29fb23

File tree

3 files changed

+11
-43
lines changed

3 files changed

+11
-43
lines changed

README.md

Lines changed: 9 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -22,52 +22,25 @@ message us on the [sigstore#java](https://sigstore.slack.com/archives/C03239XUL9
2222
Path testArtifact = Paths.get("path/to/my/file.jar")
2323

2424
var signer = KeylessSigner.builder().sigstorePublicDefaults().build();
25-
var result = signer.sign(testArtifact);
26-
27-
// resulting signature information
25+
Bundle result = signer.sign(testArtifact);
2826

2927
// sigstore bundle format (serialized as <artifact>.sigstore.json)
30-
String bundle = BundleFactory.createBundle(result)
31-
32-
// artifact digest
33-
byte[] digest = result.getDigest();
34-
35-
// certificate from fulcio
36-
CertPath certs = result.getCertPath() // java representation of a certificate path
37-
byte[] certsBytes = Certificates.toPemBytes(result.getCertPath()) // converted to PEM encoded byte array
38-
39-
// artifact signature
40-
byte[] sig = result.getSignature()
41-
28+
String bundleJson = result.toJson();
4229
```
4330

4431
#### Verification
4532

46-
##### KeylessSignature from bundle
33+
##### Read bundle
4734
```java
48-
var bundleFile = // java.nio.Path to a .sigstore.json signature bundle file
49-
var keylessSignature = BundleFactory.readBundle(Files.newBufferedReader(bundleFile, StandardCharsets.UTF_8));
35+
Path bundleFile = // java.nio.Path to a .sigstore.json signature bundle file
36+
Bundle bundle = Bundle.from(Files.newBufferedReader(bundleFile, StandardCharsets.UTF_8));
5037
```
5138

52-
##### KeylessSignature from certificate and signature
53-
```java
54-
byte[] digest = // byte array sha256 artifact digest
55-
byte[] certificateChain = // byte array of PEM encoded cert chain
56-
byte[] signature = // byte array of artifact signature
57-
var keylessSignature =
58-
KeylessSignature.builder()
59-
.signature(signature)
60-
.certPath(Certificates.fromPemChain(certPath))
61-
.digest(digest)
62-
.build();
63-
```
64-
65-
6639
##### Configure verification options
6740
```java
68-
var verificationOptions =
41+
// add certificate policy to verify the identity of the signer
42+
VerificationOptions verificationOptions =
6943
VerificationOptions.builder()
70-
// add certificate policy to verify the identity of the signer
7144
.addCertificateIdentities(
7245
CertificateIdentity.builder()
7346
.issuer("https://accounts.example.com"))
@@ -78,15 +51,10 @@ var verificationOptions =
7851

7952
##### Do verification
8053
```java
81-
var artifact = // java.nio.Path to artifact file
54+
Path artifact = // java.nio.Path to artifact file
8255
try {
8356
var verifier = new KeylessVerifier.Builder().sigstorePublicDefaults().build();
84-
verifier.verify(
85-
artifact,
86-
KeylessVerificationRequest.builder()
87-
.keylessSignature(keylessSignature)
88-
.verificationOptions(verificationOptions)
89-
.build());
57+
verifier.verify(artifact, bundle, verificationOptions);
9058
// verification passed!
9159
} catch (KeylessVerificationException e) {
9260
// verification failed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ systemProp.org.gradle.kotlin.dsl.precompiled.accessors.strict=true
44

55
group=dev.sigstore
66
# remember to update SigstoreSignExtension.kt and build-logic/publishing/build.gradle.kts when updating this
7-
version=0.9.0
7+
version=0.10.0

sigstore-gradle/sigstore-gradle-sign-base-plugin/src/main/kotlin/dev/sigstore/sign/SigstoreSignExtension.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ abstract class SigstoreSignExtension(private val project: Project) {
4444
abstract val sigstoreJavaVersion : Property<String>
4545

4646
init {
47-
sigstoreJavaVersion.convention("0.9.0")
47+
sigstoreJavaVersion.convention("0.10.0")
4848
(this as ExtensionAware).extensions.create<OidcClientExtension>(
4949
"oidcClient",
5050
project.objects,

0 commit comments

Comments
 (0)