Skip to content

Commit c80f0e9

Browse files
committed
Merge branch 'main' into timestamp-client-verifier
2 parents cf06d34 + eec57a5 commit c80f0e9

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

sigstore-java/src/main/java/dev/sigstore/TrustedRootProvider.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import com.google.common.base.Preconditions;
1919
import dev.sigstore.trustroot.SigstoreConfigurationException;
20+
import dev.sigstore.trustroot.SigstoreConfigurationException;
2021
import dev.sigstore.trustroot.SigstoreTrustedRoot;
2122
import dev.sigstore.tuf.SigstoreTufClient;
2223
import java.io.IOException;
@@ -36,6 +37,7 @@
3637
public interface TrustedRootProvider {
3738

3839
SigstoreTrustedRoot get() throws SigstoreConfigurationException;
40+
SigstoreTrustedRoot get() throws SigstoreConfigurationException;
3941

4042
static TrustedRootProvider from(SigstoreTufClient.Builder tufClientBuilder) {
4143
Preconditions.checkNotNull(tufClientBuilder);

sigstore-java/src/main/java/dev/sigstore/trustroot/SigstoreTrustedRoot.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ public interface SigstoreTrustedRoot {
5353
List<CertificateAuthority> getTSAs();
5454

5555
/** Create an instance from an input stream of a json representation of a trustedroot. */
56-
static SigstoreTrustedRoot from(InputStream json)
57-
throws SigstoreConfigurationException, CertificateException {
56+
static SigstoreTrustedRoot from(InputStream json) throws IOException, CertificateException {
5857
var trustedRootBuilder = TrustedRoot.newBuilder();
5958
try (var reader = new InputStreamReader(json, StandardCharsets.UTF_8)) {
6059
JsonFormat.parser().merge(reader, trustedRootBuilder);
@@ -65,8 +64,7 @@ static SigstoreTrustedRoot from(InputStream json)
6564
}
6665

6766
/** Create an instance from a parsed proto definition of a trustedroot. */
68-
static SigstoreTrustedRoot from(TrustedRootOrBuilder proto)
69-
throws SigstoreConfigurationException, CertificateException {
67+
static SigstoreTrustedRoot from(TrustedRootOrBuilder proto) throws CertificateException {
7068
List<CertificateAuthority> cas = Lists.newArrayList();
7169
for (var certAuthority : proto.getCertificateAuthoritiesList()) {
7270
try {

sigstore-java/src/main/java/dev/sigstore/tuf/SigstoreTufClient.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ public void update()
160160
NoSuchAlgorithmException,
161161
InvalidKeySpecException,
162162
InvalidKeyException {
163+
InvalidKeyException {
163164
if (lastUpdate == null
164165
|| Duration.between(lastUpdate, Instant.now()).compareTo(cacheValidity) > 0) {
165166
this.forceUpdate();
@@ -174,6 +175,7 @@ public void forceUpdate()
174175
NoSuchAlgorithmException,
175176
InvalidKeySpecException,
176177
InvalidKeyException {
178+
InvalidKeyException {
177179
updater.update();
178180
lastUpdate = Instant.now();
179181
var trustedRootBuilder = TrustedRoot.newBuilder();

sigstore-java/src/test/java/dev/sigstore/trustroot/SigstoreTrustedRootTest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ class SigstoreTrustedRootTest {
3232
private static SigstoreTrustedRoot trustRoot;
3333

3434
@BeforeAll
35-
public static void initTrustRoot() throws Exception {
36-
trustRoot =
37-
SigstoreTrustedRoot.from(
38-
Resources.getResource("dev/sigstore/trustroot/trusted_root.json").openStream());
3935
public static void initTrustRoot() throws Exception {
4036
trustRoot =
4137
SigstoreTrustedRoot.from(

0 commit comments

Comments
 (0)