@Test public void getCertificateAuthorities() throws Exception { List<ApprovedCaDto> caDtos = certificateAuthorityService.getCertificateAuthorities(null); assertEquals(3, caDtos.size()); caDtos = certificateAuthorityService.getCertificateAuthorities(KeyUsageInfo.SIGNING); assertEquals(2, caDtos.size()); ApprovedCaDto ca = caDtos.get(0); assertEquals("fi-not-auth-only", ca.getName()); assertFalse(ca.isAuthenticationOnly()); assertEquals("CN=N/A", ca.getIssuerDistinguishedName()); assertEquals("CN=N/A", ca.getSubjectDistinguishedName()); assertEquals(Collections.singletonList("CN=N/A"), ca.getSubjectDnPath()); assertTrue(ca.isTopCa()); assertEquals("good", ca.getOcspResponse()); assertEquals(OffsetDateTime.parse("2038-01-01T00:00Z"), ca.getNotAfter()); caDtos = certificateAuthorityService.getCertificateAuthorities(KeyUsageInfo.AUTHENTICATION); assertEquals(3, caDtos.size()); ApprovedCaDto ca2 = caDtos.get(1); assertEquals("est-auth-only", ca2.getName()); assertTrue(ca2.isAuthenticationOnly()); assertEquals(MOCK_AUTH_CERT_ISSUER, ca2.getIssuerDistinguishedName()); assertEquals(MOCK_AUTH_CERT_SUBJECT, ca2.getSubjectDistinguishedName()); assertEquals(Collections.singletonList(MOCK_AUTH_CERT_SUBJECT), ca2.getSubjectDnPath()); assertTrue(ca2.isTopCa()); assertEquals("not available", ca2.getOcspResponse()); assertEquals(OffsetDateTime.parse("2039-11-23T09:20:27Z"), ca2.getNotAfter()); cacheEvictor.evict(); when(globalConfFacade.getAllCaCerts(any())).thenReturn(new ArrayList<>()); when(signerProxyFacade.getOcspResponses(any())).thenReturn(new String[] {}); assertEquals(0, certificateAuthorityService.getCertificateAuthorities(KeyUsageInfo.SIGNING).size()); assertEquals(0, certificateAuthorityService.getCertificateAuthorities(null).size()); }
@Cacheable(GET_CERTIFICATE_AUTHORITIES_CACHE) public List<ApprovedCaDto> getCertificateAuthorities(KeyUsageInfo keyUsageInfo) throws InconsistentCaDataException { return getCertificateAuthorities(keyUsageInfo, false); }
CertificateAuthorityService { @Cacheable(GET_CERTIFICATE_AUTHORITIES_CACHE) public List<ApprovedCaDto> getCertificateAuthorities(KeyUsageInfo keyUsageInfo) throws InconsistentCaDataException { return getCertificateAuthorities(keyUsageInfo, false); } }
CertificateAuthorityService { @Cacheable(GET_CERTIFICATE_AUTHORITIES_CACHE) public List<ApprovedCaDto> getCertificateAuthorities(KeyUsageInfo keyUsageInfo) throws InconsistentCaDataException { return getCertificateAuthorities(keyUsageInfo, false); } @Autowired  CertificateAuthorityService(GlobalConfService globalConfService,
            GlobalConfFacade globalConfFacade,
            ClientService clientService,
            SignerProxyFacade signerProxyFacade,
            CurrentSecurityServerId currentSecurityServerId); }
CertificateAuthorityService { @Cacheable(GET_CERTIFICATE_AUTHORITIES_CACHE) public List<ApprovedCaDto> getCertificateAuthorities(KeyUsageInfo keyUsageInfo) throws InconsistentCaDataException { return getCertificateAuthorities(keyUsageInfo, false); } @Autowired  CertificateAuthorityService(GlobalConfService globalConfService,
            GlobalConfFacade globalConfFacade,
            ClientService clientService,
            SignerProxyFacade signerProxyFacade,
            CurrentSecurityServerId currentSecurityServerId); @Cacheable(GET_CERTIFICATE_AUTHORITIES_CACHE) List<ApprovedCaDto> getCertificateAuthorities(KeyUsageInfo keyUsageInfo); @Cacheable(GET_CERTIFICATE_AUTHORITIES_CACHE) List<ApprovedCaDto> getCertificateAuthorities(KeyUsageInfo keyUsageInfo,
            boolean includeIntermediateCas); CertificateProfileInfo getCertificateProfile(String caName, KeyUsageInfo keyUsageInfo, ClientId memberId,
            boolean isNewMember); ApprovedCAInfo getCertificateAuthorityInfo(String caName); }
CertificateAuthorityService { @Cacheable(GET_CERTIFICATE_AUTHORITIES_CACHE) public List<ApprovedCaDto> getCertificateAuthorities(KeyUsageInfo keyUsageInfo) throws InconsistentCaDataException { return getCertificateAuthorities(keyUsageInfo, false); } @Autowired  CertificateAuthorityService(GlobalConfService globalConfService,
            GlobalConfFacade globalConfFacade,
            ClientService clientService,
            SignerProxyFacade signerProxyFacade,
            CurrentSecurityServerId currentSecurityServerId); @Cacheable(GET_CERTIFICATE_AUTHORITIES_CACHE) List<ApprovedCaDto> getCertificateAuthorities(KeyUsageInfo keyUsageInfo); @Cacheable(GET_CERTIFICATE_AUTHORITIES_CACHE) List<ApprovedCaDto> getCertificateAuthorities(KeyUsageInfo keyUsageInfo,
            boolean includeIntermediateCas); CertificateProfileInfo getCertificateProfile(String caName, KeyUsageInfo keyUsageInfo, ClientId memberId,
            boolean isNewMember); ApprovedCAInfo getCertificateAuthorityInfo(String caName); static final String OCSP_RESPONSE_NOT_AVAILABLE; }