@Test public void importTrustCertificateStrings() throws KeystoreException, CertificateException { underTest.importTrustCertificate(CERT_IN_PEM_UNIX, "test"); verify(keyStoreManager).importTrustCertificate(isA(Certificate.class), eq("test")); verify(freezeService).checkWritable("Unable to import a certificate while database is frozen."); }
@Override public Certificate importTrustCertificate(final Certificate certificate, final String alias) throws KeystoreException { freezeService.checkWritable("Unable to import a certificate while database is frozen."); keyStoreManager.importTrustCertificate(certificate, alias); eventManager.post(new CertificateCreatedEvent(alias, certificate)); log.info("Certificate added successfully in trust-store with Fingerprint: {}, Name: {} and SHA1 Identifier: {} ", alias, getCertificateName(certificate), getCertificateSha1(certificate)); return certificate; }
TrustStoreImpl extends ComponentSupport implements EventAware, TrustStore { @Override public Certificate importTrustCertificate(final Certificate certificate, final String alias) throws KeystoreException { freezeService.checkWritable("Unable to import a certificate while database is frozen."); keyStoreManager.importTrustCertificate(certificate, alias); eventManager.post(new CertificateCreatedEvent(alias, certificate)); log.info("Certificate added successfully in trust-store with Fingerprint: {}, Name: {} and SHA1 Identifier: {} ", alias, getCertificateName(certificate), getCertificateSha1(certificate)); return certificate; } }
TrustStoreImpl extends ComponentSupport implements EventAware, TrustStore { @Override public Certificate importTrustCertificate(final Certificate certificate, final String alias) throws KeystoreException { freezeService.checkWritable("Unable to import a certificate while database is frozen."); keyStoreManager.importTrustCertificate(certificate, alias); eventManager.post(new CertificateCreatedEvent(alias, certificate)); log.info("Certificate added successfully in trust-store with Fingerprint: {}, Name: {} and SHA1 Identifier: {} ", alias, getCertificateName(certificate), getCertificateSha1(certificate)); return certificate; } @Inject  TrustStoreImpl(final EventManager eventManager,
                        @Named("ssl") final KeyStoreManager keyStoreManager,
                        final FreezeService freezeService); }
TrustStoreImpl extends ComponentSupport implements EventAware, TrustStore { @Override public Certificate importTrustCertificate(final Certificate certificate, final String alias) throws KeystoreException { freezeService.checkWritable("Unable to import a certificate while database is frozen."); keyStoreManager.importTrustCertificate(certificate, alias); eventManager.post(new CertificateCreatedEvent(alias, certificate)); log.info("Certificate added successfully in trust-store with Fingerprint: {}, Name: {} and SHA1 Identifier: {} ", alias, getCertificateName(certificate), getCertificateSha1(certificate)); return certificate; } @Inject  TrustStoreImpl(final EventManager eventManager,
                        @Named("ssl") final KeyStoreManager keyStoreManager,
                        final FreezeService freezeService); @Override Certificate importTrustCertificate(final Certificate certificate, final String alias); @Override Certificate importTrustCertificate(final String certificateInPEM, final String alias); @Override Certificate getTrustedCertificate(final String alias); @Override Collection<Certificate> getTrustedCertificates(); @Override void removeTrustCertificate(final String alias); @Override SSLContext getSSLContext(); @Override KeyManager[] getKeyManagers(); @Subscribe void onKeyStoreDataUpdated(final KeyStoreDataEvent event); }
TrustStoreImpl extends ComponentSupport implements EventAware, TrustStore { @Override public Certificate importTrustCertificate(final Certificate certificate, final String alias) throws KeystoreException { freezeService.checkWritable("Unable to import a certificate while database is frozen."); keyStoreManager.importTrustCertificate(certificate, alias); eventManager.post(new CertificateCreatedEvent(alias, certificate)); log.info("Certificate added successfully in trust-store with Fingerprint: {}, Name: {} and SHA1 Identifier: {} ", alias, getCertificateName(certificate), getCertificateSha1(certificate)); return certificate; } @Inject  TrustStoreImpl(final EventManager eventManager,
                        @Named("ssl") final KeyStoreManager keyStoreManager,
                        final FreezeService freezeService); @Override Certificate importTrustCertificate(final Certificate certificate, final String alias); @Override Certificate importTrustCertificate(final String certificateInPEM, final String alias); @Override Certificate getTrustedCertificate(final String alias); @Override Collection<Certificate> getTrustedCertificates(); @Override void removeTrustCertificate(final String alias); @Override SSLContext getSSLContext(); @Override KeyManager[] getKeyManagers(); @Subscribe void onKeyStoreDataUpdated(final KeyStoreDataEvent event); static final SecureRandom DEFAULT_RANDOM; }