File tree Expand file tree Collapse file tree 4 files changed +6
-8
lines changed
test/java/dev/sigstore/trustroot Expand file tree Collapse file tree 4 files changed +6
-8
lines changed Original file line number Diff line number Diff line change 1717
1818import com .google .common .base .Preconditions ;
1919import dev .sigstore .trustroot .SigstoreConfigurationException ;
20+ import dev .sigstore .trustroot .SigstoreConfigurationException ;
2021import dev .sigstore .trustroot .SigstoreTrustedRoot ;
2122import dev .sigstore .tuf .SigstoreTufClient ;
2223import java .io .IOException ;
3637public 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 );
Original file line number Diff line number Diff 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 {
Original file line number Diff line number Diff 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 ();
Original file line number Diff line number Diff 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 (
You can’t perform that action at this time.
0 commit comments