class 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 public  TrustStoreImpl(final EventManager eventManager,
                        @Named("ssl") final KeyStoreManager keyStoreManager,
                        final FreezeService freezeService);

}