@Test public void testNormalTrust2() { CertificateVerifier certificateVerifier = new CommonCertificateVerifier(); CertificateSource trustCertSource = new CommonTrustedCertificateSource(); trustCertSource.addCertificate(c3); certificateVerifier.setTrustedCertSources(trustCertSource); CommonSignatureParamaters parameters = new CommonSignatureParamaters(); parameters.setSigningCertificate(c1); parameters.setCertificateChain(c2, c3); BaselineBCertificateSelector selector = new BaselineBCertificateSelector(certificateVerifier, parameters); List<CertificateToken> certificates = selector.getCertificates(); assertEquals(2, certificates.size()); assertEquals(c1, certificates.get(0)); assertEquals(c2, certificates.get(1)); }
public List<CertificateToken> getCertificates() { List<CertificateToken> orderedCertificates = getOrderedCertificates(); ListCertificateSource trustedCertSources = certificateVerifier.getTrustedCertSources(); if (parameters.bLevel().isTrustAnchorBPPolicy() && !trustedCertSources.isEmpty()) { List<CertificateToken> result = new LinkedList<>(); for (CertificateToken certificateToken : orderedCertificates) { if (trustedCertSources.isTrusted(certificateToken)) { break; } result.add(certificateToken); } return result; } else { return orderedCertificates; } }
BaselineBCertificateSelector extends CertificateReorderer { public List<CertificateToken> getCertificates() { List<CertificateToken> orderedCertificates = getOrderedCertificates(); ListCertificateSource trustedCertSources = certificateVerifier.getTrustedCertSources(); if (parameters.bLevel().isTrustAnchorBPPolicy() && !trustedCertSources.isEmpty()) { List<CertificateToken> result = new LinkedList<>(); for (CertificateToken certificateToken : orderedCertificates) { if (trustedCertSources.isTrusted(certificateToken)) { break; } result.add(certificateToken); } return result; } else { return orderedCertificates; } } }
BaselineBCertificateSelector extends CertificateReorderer { public List<CertificateToken> getCertificates() { List<CertificateToken> orderedCertificates = getOrderedCertificates(); ListCertificateSource trustedCertSources = certificateVerifier.getTrustedCertSources(); if (parameters.bLevel().isTrustAnchorBPPolicy() && !trustedCertSources.isEmpty()) { List<CertificateToken> result = new LinkedList<>(); for (CertificateToken certificateToken : orderedCertificates) { if (trustedCertSources.isTrusted(certificateToken)) { break; } result.add(certificateToken); } return result; } else { return orderedCertificates; } } BaselineBCertificateSelector(CertificateVerifier certificateVerifier, AbstractSignatureParameters parameters); }
BaselineBCertificateSelector extends CertificateReorderer { public List<CertificateToken> getCertificates() { List<CertificateToken> orderedCertificates = getOrderedCertificates(); ListCertificateSource trustedCertSources = certificateVerifier.getTrustedCertSources(); if (parameters.bLevel().isTrustAnchorBPPolicy() && !trustedCertSources.isEmpty()) { List<CertificateToken> result = new LinkedList<>(); for (CertificateToken certificateToken : orderedCertificates) { if (trustedCertSources.isTrusted(certificateToken)) { break; } result.add(certificateToken); } return result; } else { return orderedCertificates; } } BaselineBCertificateSelector(CertificateVerifier certificateVerifier, AbstractSignatureParameters parameters); List<CertificateToken> getCertificates(); }
BaselineBCertificateSelector extends CertificateReorderer { public List<CertificateToken> getCertificates() { List<CertificateToken> orderedCertificates = getOrderedCertificates(); ListCertificateSource trustedCertSources = certificateVerifier.getTrustedCertSources(); if (parameters.bLevel().isTrustAnchorBPPolicy() && !trustedCertSources.isEmpty()) { List<CertificateToken> result = new LinkedList<>(); for (CertificateToken certificateToken : orderedCertificates) { if (trustedCertSources.isTrusted(certificateToken)) { break; } result.add(certificateToken); } return result; } else { return orderedCertificates; } } BaselineBCertificateSelector(CertificateVerifier certificateVerifier, AbstractSignatureParameters parameters); List<CertificateToken> getCertificates();  }