@Test void validV1CertificatePath() throws Exception { Collection<X509CertificateHolder> certs = new ArrayList<>(); certs.add(BcUtils.getX509CertificateHolder(v1CaCert)); CollectionStore store = new CollectionStore(certs); CertificateProvider provider = componentManager.getInstance(CertificateProvider.class, "BCStoreX509"); ((BcStoreX509CertificateProvider) provider).setStore(store); Collection<CertifiedPublicKey> chain = builder.build(v1Cert, provider); assertThat(chain, contains(v1CaCert, v1Cert)); }
@Override public Collection<CertifiedPublicKey> build(CertifiedPublicKey certificate, CertificateProvider provider) { if (certificate == null) { return null; } Deque<CertifiedPublicKey> result = new ArrayDeque<>(); build(result, certificate, provider); return result; }
BcX509CertificateChainBuilder implements CertificateChainBuilder { @Override public Collection<CertifiedPublicKey> build(CertifiedPublicKey certificate, CertificateProvider provider) { if (certificate == null) { return null; } Deque<CertifiedPublicKey> result = new ArrayDeque<>(); build(result, certificate, provider); return result; } }
BcX509CertificateChainBuilder implements CertificateChainBuilder { @Override public Collection<CertifiedPublicKey> build(CertifiedPublicKey certificate, CertificateProvider provider) { if (certificate == null) { return null; } Deque<CertifiedPublicKey> result = new ArrayDeque<>(); build(result, certificate, provider); return result; }  }
BcX509CertificateChainBuilder implements CertificateChainBuilder { @Override public Collection<CertifiedPublicKey> build(CertifiedPublicKey certificate, CertificateProvider provider) { if (certificate == null) { return null; } Deque<CertifiedPublicKey> result = new ArrayDeque<>(); build(result, certificate, provider); return result; }  @Override Collection<CertifiedPublicKey> build(CertifiedPublicKey certificate, CertificateProvider provider); }
BcX509CertificateChainBuilder implements CertificateChainBuilder { @Override public Collection<CertifiedPublicKey> build(CertifiedPublicKey certificate, CertificateProvider provider) { if (certificate == null) { return null; } Deque<CertifiedPublicKey> result = new ArrayDeque<>(); build(result, certificate, provider); return result; }  @Override Collection<CertifiedPublicKey> build(CertifiedPublicKey certificate, CertificateProvider provider);  }