- Notifications
You must be signed in to change notification settings - Fork25
sigstore/sigstore-java
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
A sigstore java client for interacting with sigstore infrastructure
You can fileissues directly on this project orif you have any questions message us on thesigstore#javaslack channel
- Java 11
For use directly with your java build. Seemaven orgradlebuild plugin specifics.
PathtestArtifact =Paths.get("path/to/my/file.jar")// sign using the sigstore public instancevarsigner =KeylessSigner.builder().sigstorePublicDefaults().build();Bundleresult =signer.signFile(testArtifact);// sigstore bundle format (serialized as <artifact>.sigstore.json)StringbundleJson =result.toJson();
Pathartifact =Paths.get("path/to/my-artifact");// import a json formatted sigstore bundlePathbundleFile =Paths.get("path/to/my-artifact.sigstore.json");Bundlebundle =Bundle.from(bundleFile,StandardCharsets.UTF_8);
// add certificate policy to verify the identity of the signerVerificationOptionsoptions =VerificationOptions.builder().addCertificateMatchers(CertificateMatcher.fulcio() .subjectAlternativeName(StringMatcher.string("test@example.com")) .issuer(StringMatcher.string("https://accounts.example.com")) .build());
try {// verify using the sigstore public instancevarverifier =newKeylessVerifier.builder().sigstorePublicDefaults().build();verifier.verify(artifact,bundle,verificationOptions);// verification passed!}catch (KeylessVerificationExceptione) {// verification failed}
sigstore-java doesn't create DSSE bundles yet, but it can verify the signatures over them with the sameKeylessVerifier workflow detailed above. While sigstore-java inspects theembedded payloadto ensure the provided artifact is a subject in thein-toto statementit is not able to make any further assertions about the payload. Consumers of DSSE bundles should inspectthe embedded payload to verify extended attestation data using tools likeslsa-verifier.
The public stable API is limited todev.sigstore.KeylessSigner anddev.sigstore.KeylessVerifier and the classes exposed by those APIs. Other classes in the library are subject to change without notice.
You can browse Javadoc athttps://javadoc.io/doc/dev.sigstore/sigstore-java.
To build and view javadoc from the sources, use the following command:
$ ./gradlew javadoc$"my-favorite-browser" ./sigstore-java/build/docs/javadoc/index.htmlSigstore Java and Sigstore Maven Plugin are signed with both PGP and sigstore.
| Version Range | Key Id |
|---|---|
| 1.X.X | AC74A3385D0E3252 |
| 2.X.X | 00E008229F5DAF37 |
| Version Range | Issuer | Signer Id |
|---|---|---|
| 1.0.0 - 2.X.X | https://token.actions.githubusercontent.com | https://github.com/sigstore/sigstore-java/.github/workflows/release-sigstore-java-from-tag.yaml@refs/tags/X.X.X |
About
java clients for sigstore
Resources
License
Code of conduct
Contributing
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.