use of uk.gov.ida.truststore.KeyStoreLoader in project verify-hub by alphagov.
the class CryptoModule method configure.
@Override
protected void configure() {
bind(EncryptionKeyStore.class).to(HubEncryptionKeyStore.class).asEagerSingleton();
bind(SigningKeyStore.class).annotatedWith(Names.named("authnRequestKeyStore")).to(AuthnRequestKeyStore.class).asEagerSingleton();
bind(SigningKeyStore.class).annotatedWith(Names.named("samlResponseFromMatchingServiceKeyStore")).to(SamlResponseFromMatchingServiceKeyStore.class).asEagerSingleton();
bind(X509CertificateFactory.class).toInstance(new X509CertificateFactory());
bind(CertificateChainValidator.class);
bind(PKIXParametersProvider.class).toInstance(new PKIXParametersProvider());
bind(CertificatesConfigProxy.class);
bind(TrustStoreForCertificateProvider.class);
bind(KeyStoreCache.class);
bind(KeyStoreLoader.class).toInstance(new KeyStoreLoader());
bind(AssertionBlobEncrypter.class);
bind(EncrypterFactory.class).toInstance(new EncrypterFactory());
bind(SignatureAlgorithm.class).toInstance(new SignatureRSASHA1());
bind(DigestAlgorithm.class).toInstance(new DigestSHA256());
}
use of uk.gov.ida.truststore.KeyStoreLoader in project verify-hub by alphagov.
the class SamlEngineApplication method run.
@Override
public final void run(SamlEngineConfiguration configuration, Environment environment) {
IdaSamlBootstrap.bootstrap();
environment.getObjectMapper().registerModule(new GuavaModule());
environment.getObjectMapper().setDateFormat(new StdDateFormat());
// register resources
registerResources(environment, configuration);
// register exception mappers
environment.jersey().register(SamlEngineExceptionMapper.class);
// calling .get() here is safe because the Optional is never empty
MetadataResolverConfiguration metadataConfiguration = configuration.getMetadataConfiguration().get();
ClientTrustStoreConfiguration rpTrustStoreConfiguration = configuration.getRpTrustStoreConfiguration();
KeyStore rpTrustStore = new KeyStoreLoader().load(rpTrustStoreConfiguration.getPath(), rpTrustStoreConfiguration.getPassword());
TrustStoreMetrics trustStoreMetrics = new TrustStoreMetrics();
metadataConfiguration.getHubTrustStore().ifPresent(hubTrustStore -> trustStoreMetrics.registerTrustStore("hub", hubTrustStore));
metadataConfiguration.getIdpTrustStore().ifPresent(idpTrustStore -> trustStoreMetrics.registerTrustStore("idp", idpTrustStore));
trustStoreMetrics.registerTrustStore("rp", rpTrustStore);
environment.servlets().addFilter("Logging SessionId registration Filter", SessionIdQueryParamLoggingFilter.class).addMappingForUrlPatterns(EnumSet.allOf(DispatcherType.class), true, "/*");
}
use of uk.gov.ida.truststore.KeyStoreLoader in project verify-hub by alphagov.
the class ConfigModule method configure.
@Override
protected void configure() {
bind(ConfigHealthCheck.class).asEagerSingleton();
bind(ConfigDataBootstrap.class).asEagerSingleton();
bind(CertificateChainConfigValidator.class).asEagerSingleton();
bind(TrustStoreConfiguration.class).to(ConfigConfiguration.class);
bind(new TypeLiteral<ConfigurationFactoryFactory<IdentityProviderConfig>>() {
}).toInstance(new DefaultConfigurationFactoryFactory<>());
bind(new TypeLiteral<ConfigurationFactoryFactory<TransactionConfig>>() {
}).toInstance(new DefaultConfigurationFactoryFactory<>());
bind(new TypeLiteral<ConfigurationFactoryFactory<MatchingServiceConfig>>() {
}).toInstance(new DefaultConfigurationFactoryFactory<>());
bind(new TypeLiteral<ConfigurationFactoryFactory<TranslationData>>() {
}).toInstance(new DefaultConfigurationFactoryFactory<>());
bind(new TypeLiteral<ConfigDataSource<TransactionConfig>>() {
}).to(FileBackedTransactionConfigDataSource.class).asEagerSingleton();
bind(new TypeLiteral<ConfigDataSource<TranslationData>>() {
}).to(FileBackedTranslationsDataSource.class).asEagerSingleton();
bind(new TypeLiteral<ConfigDataSource<MatchingServiceConfig>>() {
}).to(FileBackedMatchingServiceConfigDataSource.class).asEagerSingleton();
bind(new TypeLiteral<ConfigDataSource<IdentityProviderConfig>>() {
}).to(FileBackedIdentityProviderConfigDataSource.class).asEagerSingleton();
bind(new TypeLiteral<LocalConfigRepository<TransactionConfig>>() {
}).asEagerSingleton();
bind(new TypeLiteral<LocalConfigRepository<TranslationData>>() {
}).asEagerSingleton();
bind(new TypeLiteral<LocalConfigRepository<MatchingServiceConfig>>() {
}).asEagerSingleton();
bind(new TypeLiteral<LocalConfigRepository<IdentityProviderConfig>>() {
}).asEagerSingleton();
bind(new TypeLiteral<ManagedEntityConfigRepository<TransactionConfig>>() {
}).asEagerSingleton();
bind(new TypeLiteral<ManagedEntityConfigRepository<MatchingServiceConfig>>() {
}).asEagerSingleton();
bind(LevelsOfAssuranceConfigValidator.class).toInstance(new LevelsOfAssuranceConfigValidator());
bind(CertificateChainValidator.class);
bind(TrustStoreForCertificateProvider.class);
bind(X509CertificateFactory.class).toInstance(new X509CertificateFactory());
bind(KeyStoreCache.class);
bind(ExceptionFactory.class);
bind(OCSPCertificateChainValidityChecker.class);
bind(OCSPCertificateChainValidator.class);
bind(IdpPredicateFactory.class);
bind(KeyStoreLoader.class).toInstance(new KeyStoreLoader());
bind(OCSPPKIXParametersProvider.class).toInstance(new OCSPPKIXParametersProvider());
bind(PKIXParametersProvider.class).toInstance(new PKIXParametersProvider());
}
use of uk.gov.ida.truststore.KeyStoreLoader in project verify-hub by alphagov.
the class SamlSoapProxyModule method configure.
@Override
protected void configure() {
bind(TrustStoreConfiguration.class).to(SamlSoapProxyConfiguration.class);
bind(PublicKeyInputStreamFactory.class).toInstance(new PublicKeyFileInputStreamFactory());
bind(RestfulClientConfiguration.class).to(SamlSoapProxyConfiguration.class);
bind(Client.class).toProvider(DefaultClientProvider.class).asEagerSingleton();
bind(new TypeLiteral<ConfigurationFactoryFactory<SupportedMsaVersions>>() {
}).toInstance(new DefaultConfigurationFactoryFactory<>() {
});
bind(new TypeLiteral<SupportedMsaVersionsRepository>() {
}).asEagerSingleton();
bind(SupportedMsaVersionsBootstrap.class).asEagerSingleton();
bind(SupportedMsaVersionsLoader.class).asEagerSingleton();
bind(MetadataRefreshTask.class).asEagerSingleton();
bind(ConfigServiceKeyStore.class).asEagerSingleton();
bind(ExpiredCertificateMetadataFilter.class).toInstance(new ExpiredCertificateMetadataFilter());
bind(UrlConfigurationSourceProvider.class).toInstance(new UrlConfigurationSourceProvider());
bind(TrustStoreForCertificateProvider.class);
bind(JsonResponseProcessor.class);
bind(X509CertificateFactory.class).toInstance(new X509CertificateFactory());
bind(CertificateChainValidator.class);
bind(CertificatesConfigProxy.class);
bind(PKIXParametersProvider.class).toInstance(new PKIXParametersProvider());
bind(KeyStoreCache.class);
bind(KeyStoreLoader.class).toInstance(new KeyStoreLoader());
bind(MatchingServiceHealthCheckHandler.class);
bind(MatchingServiceHealthChecker.class);
bind(MatchingServiceConfigProxy.class);
bind(MatchingServiceHealthCheckClient.class);
bind(HealthCheckEventLogger.class);
bind(SamlEngineProxy.class);
bind(HealthCheckSoapRequestClient.class);
bind(AttributeQueryRequestRunnableFactory.class);
bind(ExecuteAttributeQueryRequest.class);
bind(AttributeQueryRequestClient.class);
bind(ProtectiveMonitoringLogger.class).toInstance(new ProtectiveMonitoringLogger());
bind(SoapRequestClient.class);
bind(HubMatchingServiceResponseReceiverProxy.class);
bind(ExternalCommunicationEventLogger.class);
bind(SoapMessageManager.class).toInstance(new SoapMessageManager());
bind(IpAddressResolver.class).toInstance(new IpAddressResolver());
bind(TimeoutEvaluator.class).toInstance(new TimeoutEvaluator());
}
Aggregations