@@ -0,0 +1,1393 @@
+package org.gluu.oxauth.service;%0A%0Aimport javax.enterprise.context.ApplicationScoped;%0Aimport javax.enterprise.inject.Produces;%0Aimport javax.inject.Inject;%0Aimport javax.inject.Named;%0A%0Aimport org.gluu.oxauth.model.common.WebKeyStorage;%0Aimport org.gluu.oxauth.model.configuration.AppConfiguration;%0Aimport org.gluu.oxauth.model.crypto.AbstractCryptoProvider;%0Aimport org.slf4j.Logger;%0A%0A/**%0A * Crypto Provider%0A * %0A * @author Yuriy Movchan%0A * @version 11/02/2018%0A */%0A@ApplicationScoped%0A@Named%0Apublic class CryptoProviderProviderFactory %7B%0A%0A    @Inject%0A    private Logger log;%0A%0A    @Inject%0A    private AppConfiguration appConfiguration;%0A%0A    @Produces%0A    @ApplicationScoped%0A    public AbstractCryptoProvider getCacheProvider() throws Exception %7B%0A        log.debug(%22Started to create crypto provider%22);%0A%0A        WebKeyStorage webKeyStorage = appConfiguration.getWebKeysStorage();%0A        if (webKeyStorage == null) %7B%0A            throw new RuntimeException(%22Failed to initialize cryptoProvider, cryptoProviderType is not specified!%22);%0A        %7D%0A%0A        AbstractCryptoProvider cryptoProvider = org.gluu.oxauth.model.crypto.CryptoProviderFactory.getCryptoProvider(appConfiguration);%0A%0A        if (cryptoProvider == null) %7B%0A            throw new RuntimeException(%22Failed to initialize cryptoProvider, cryptoProviderType is unsupported: %22 + webKeyStorage);%0A        %7D%0A%0A        return cryptoProvider;%0A    %7D%0A%0A%7D%0A

Allow to inject AbstractCryptoProvider into services