Class AbstractCryptoBeanDefinitionRegistryPostProcessor

java.lang.Object
ch.admin.bit.jeap.crypto.spring.AbstractCryptoBeanDefinitionRegistryPostProcessor
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.config.BeanFactoryPostProcessor, org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor, org.springframework.context.EnvironmentAware

public abstract class AbstractCryptoBeanDefinitionRegistryPostProcessor extends Object implements org.springframework.context.EnvironmentAware, org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor
A BeanDefinitionRegistryPostProcessor that registers two beans per configured encrpytion key:
  • A CryptoService named _keyName_CryptoService
  • A KeyManagementService named _keyName_KeyManagementService

This allows for injection of the crypto service for a specific encryption key using the bean name or a qualifier:

     @Qualifier("myKeyCryptoService")
     @Autowired
     CryptoService cryptoService;
 
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.springframework.core.env.Environment
     
  • Constructor Summary

    Constructors
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    registerBeans(org.springframework.beans.factory.support.BeanDefinitionRegistry registry, String keyId, ch.admin.bit.jeap.crypto.api.KeyReference keyReference, ch.admin.bit.jeap.crypto.internal.core.dataformat.JeapCryptoDataFormat dataFormat, String kmsBeanName)
     
    void
    setEnvironment(org.springframework.core.env.Environment environment)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor

    postProcessBeanDefinitionRegistry, postProcessBeanFactory
  • Field Details

    • environment

      protected org.springframework.core.env.Environment environment
  • Constructor Details

    • AbstractCryptoBeanDefinitionRegistryPostProcessor

      public AbstractCryptoBeanDefinitionRegistryPostProcessor()
  • Method Details

    • registerBeans

      protected void registerBeans(org.springframework.beans.factory.support.BeanDefinitionRegistry registry, String keyId, ch.admin.bit.jeap.crypto.api.KeyReference keyReference, ch.admin.bit.jeap.crypto.internal.core.dataformat.JeapCryptoDataFormat dataFormat, String kmsBeanName)
    • setEnvironment

      public void setEnvironment(org.springframework.core.env.Environment environment)
      Specified by:
      setEnvironment in interface org.springframework.context.EnvironmentAware