diff --git a/build.gradle.kts b/build.gradle.kts index fa1d8d0f..a80d7298 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -18,7 +18,9 @@ dependencies { implementation("com.google.api-client:google-api-client-gson:1.31.5") implementation("com.google.code.gson:gson:2.8.9") - implementation("org.conscrypt:conscrypt-openjdk-uber:2.5.2") // contains library code for all platforms + implementation("org.conscrypt:conscrypt-openjdk-uber:2.5.2") { + because("contains library code for all platforms") + } testImplementation("junit:junit:4.12") testImplementation("com.nimbusds:oauth2-oidc-sdk:6.21.2") diff --git a/src/main/java/dev/sigstore/fulcio/client/FulcioValidator.java b/src/main/java/dev/sigstore/fulcio/client/FulcioValidator.java index a14bba40..34b899da 100644 --- a/src/main/java/dev/sigstore/fulcio/client/FulcioValidator.java +++ b/src/main/java/dev/sigstore/fulcio/client/FulcioValidator.java @@ -37,7 +37,7 @@ public class FulcioValidator { private final CTLogInfo ctLogInfo; private final TrustAnchor fulcioRoot; - public static FulcioValidator NewFulcioValidator(byte[] ctfePublicKey, byte[] fulcioRoot) + public static FulcioValidator newFulcioValidator(byte[] ctfePublicKey, byte[] fulcioRoot) throws InvalidKeySpecException, NoSuchAlgorithmException, CertificateException, IOException, InvalidAlgorithmParameterException { KeyFactory keyFactory = KeyFactory.getInstance("EC"); @@ -91,17 +91,15 @@ public void validateCertChain(SigningCertificate sc) throws FulcioValidationExce try { cpv = CertPathValidator.getInstance("PKIX"); } catch (NoSuchAlgorithmException e) { - // no PKIX, we probably shouldn't be here, but this seems to be a system library error - // not a program control flow issue - throw new RuntimeException(e); + // + throw new RuntimeException("No PKIX CertPathValidator, we probably shouldn't be here, but this seems to be a system library error not a program control flow issue", e); } PKIXParameters pkixParams; try { pkixParams = new PKIXParameters(Collections.singleton(fulcioRoot)); } catch (InvalidAlgorithmParameterException e) { - // this should have been checked when generating a validator instance - throw new RuntimeException(e); + throw new RuntimeException("Can't create PKIX parameters for fulcioRoot. This should have been checked when generating a validator instance", e); } pkixParams.setRevocationEnabled(false);