@Test void testVerifyChain_chainCanBeVerifiedWithAuthorityInBundle() throws Exception { HashSet<X509Certificate> x509Authorities = new HashSet<>(); x509Authorities.add(rootCa.getCertificate()); x509Authorities.add(otherRootCa.getCertificate()); val x509Bundle = new X509Bundle(TrustDomain.of("example.org"), x509Authorities); X509SvidValidator.verifyChain(chain, x509Bundle); }
public static void verifyChain( @NonNull final List<X509Certificate> chain, @NonNull final BundleSource<X509Bundle> x509BundleSource) throws CertificateException, BundleNotFoundException { val trustDomain = CertificateUtils.getTrustDomain(chain); val x509Bundle = x509BundleSource.getBundleForTrustDomain(trustDomain); try { CertificateUtils.validate(chain, x509Bundle.getX509Authorities()); } catch (CertPathValidatorException e) { throw new CertificateException("Cert chain cannot be verified", e); } }
X509SvidValidator { public static void verifyChain( @NonNull final List<X509Certificate> chain, @NonNull final BundleSource<X509Bundle> x509BundleSource) throws CertificateException, BundleNotFoundException { val trustDomain = CertificateUtils.getTrustDomain(chain); val x509Bundle = x509BundleSource.getBundleForTrustDomain(trustDomain); try { CertificateUtils.validate(chain, x509Bundle.getX509Authorities()); } catch (CertPathValidatorException e) { throw new CertificateException("Cert chain cannot be verified", e); } } }
X509SvidValidator { public static void verifyChain( @NonNull final List<X509Certificate> chain, @NonNull final BundleSource<X509Bundle> x509BundleSource) throws CertificateException, BundleNotFoundException { val trustDomain = CertificateUtils.getTrustDomain(chain); val x509Bundle = x509BundleSource.getBundleForTrustDomain(trustDomain); try { CertificateUtils.validate(chain, x509Bundle.getX509Authorities()); } catch (CertPathValidatorException e) { throw new CertificateException("Cert chain cannot be verified", e); } } private  X509SvidValidator(); }
X509SvidValidator { public static void verifyChain( @NonNull final List<X509Certificate> chain, @NonNull final BundleSource<X509Bundle> x509BundleSource) throws CertificateException, BundleNotFoundException { val trustDomain = CertificateUtils.getTrustDomain(chain); val x509Bundle = x509BundleSource.getBundleForTrustDomain(trustDomain); try { CertificateUtils.validate(chain, x509Bundle.getX509Authorities()); } catch (CertPathValidatorException e) { throw new CertificateException("Cert chain cannot be verified", e); } } private  X509SvidValidator(); static void verifyChain(
            @NonNull final List<X509Certificate> chain,
            @NonNull final BundleSource<X509Bundle> x509BundleSource); static void verifySpiffeId(@NonNull final X509Certificate x509Certificate,
                                      @NonNull final Supplier<Set<SpiffeId>> acceptedSpiffeIdsSupplier); }
X509SvidValidator { public static void verifyChain( @NonNull final List<X509Certificate> chain, @NonNull final BundleSource<X509Bundle> x509BundleSource) throws CertificateException, BundleNotFoundException { val trustDomain = CertificateUtils.getTrustDomain(chain); val x509Bundle = x509BundleSource.getBundleForTrustDomain(trustDomain); try { CertificateUtils.validate(chain, x509Bundle.getX509Authorities()); } catch (CertPathValidatorException e) { throw new CertificateException("Cert chain cannot be verified", e); } } private  X509SvidValidator(); static void verifyChain(
            @NonNull final List<X509Certificate> chain,
            @NonNull final BundleSource<X509Bundle> x509BundleSource); static void verifySpiffeId(@NonNull final X509Certificate x509Certificate,
                                      @NonNull final Supplier<Set<SpiffeId>> acceptedSpiffeIdsSupplier);  }