All Downloads are FREE. Search and download functionalities are using the official Maven repository.

refcodes-cryptography-alt-filesystem.0.2.0.source-code.refcodes-cryptography-context.xml Maven / Gradle / Ivy

The newest version!
<?xml version="1.0" encoding="UTF-8"?>
<!-- ===========================================================================
// REFCODES.ORG
// =============================================================================
// This code is copyright (c) by Siegfried Steiner, Munich, Germany and licensed
// under the following (see "http://en.wikipedia.org/wiki/Multi-licensing")
// licenses:
// =============================================================================
// GNU General Public License, v3.0 ("http://www.gnu.org/licenses/gpl-3.0.html")
// =============================================================================
// Apache License, v2.0 ("http://www.apache.org/licenses/LICENSE-2.0")
// =============================================================================
// Please contact the copyright holding author(s) of the software artifacts in
// question for licensing issues not being covered by the above listed licenses,
// also regarding commercial licensing models or regarding the compatibility
// with other open source licenses.
// ========================================================================= -->

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context.xsd
        http://www.springframework.org/schema/tx
        http://www.springframework.org/schema/tx/spring-tx.xsd">

	<!--/////////////////////////////////////////////////////////////////// -->
	<!-- CRYPTOGRAPHY DATA STORE SERVICE                                     -->
	<!--/////////////////////////////////////////////////////////////////// -->
	<bean id="cryptographyFileSystem" class="org.refcodes.filesystem.impls.InMemoryFileSystemImpl" lazy-init="true" />

	<!--/////////////////////////////////////////////////////////////////// -->
	<!-- ENCRYPTION SERVER                                                   -->
	<!--/////////////////////////////////////////////////////////////////// -->
	<bean id="encryptionServer" class="org.refcodes.cryptography.alt.filesystem.impls.FileSystemEncryptionServerImpl" lazy-init="true">
		<constructor-arg ref="cryptographyFileSystem" />
		<constructor-arg value="${CRYPTOGRAPHY_FILESYSTEM_PATH}"/>
	</bean>

	<!--/////////////////////////////////////////////////////////////////// -->
	<!-- ENCRYPTION SERVICE                                                  -->
	<!--/////////////////////////////////////////////////////////////////// -->
	<bean id="encryptionService" class="org.refcodes.cryptography.impls.PublicKeyEncryptionServiceImpl" lazy-init="true">
		<constructor-arg value="${CRYPTOGRAPHY_NAMESPACE}"/>
		<constructor-arg value="${CRYPTOGRAPHY_SERVER_PUBLIC_KEY_PATH}"/>
		<constructor-arg ref="encryptionServer"/>
	</bean>
	
	<!--/////////////////////////////////////////////////////////////////// -->
	<!-- ENCRYPTION PROVIDER                                                 -->
	<!--/////////////////////////////////////////////////////////////////// -->
	<bean id="encryptionProvider" class="org.refcodes.cryptography.impls.EncryptionProviderImpl" lazy-init="true">
		<constructor-arg ref="encryptionService"/>
	</bean>
	
	<!--/////////////////////////////////////////////////////////////////// -->
	<!-- DECRYPTION PROVIDER                                                 -->
	<!--/////////////////////////////////////////////////////////////////// -->
	<bean id="decryptionProvider" class="org.refcodes.cryptography.impls.DecryptionProviderImpl" lazy-init="true">
		<constructor-arg ref="decryptionService"/>
	</bean>
	
	<!--/////////////////////////////////////////////////////////////////// -->
	<!-- DECRYPTION SERVICE                                                  -->
	<!--/////////////////////////////////////////////////////////////////// -->
	<bean id="decryptionService" class="org.refcodes.cryptography.impls.PublicKeyDecryptionServiceImpl" lazy-init="true">
		<constructor-arg value="${CRYPTOGRAPHY_NAMESPACE}"/>
		<constructor-arg value="${CRYPTOGRAPHY_SERVICE_PRIVATE_KEY_PATH}"/>
		<constructor-arg ref="decryptionServerWrapper"/>
		<property name="CipherVersionsExpireTimeInMs" value="${CRYPTOGRAPHY_DECRYPTION_SERVICE_CIPHER_VERSIONS_EXPIRE_TIME_IN_MS}"/>
	</bean>
	
	<!--/////////////////////////////////////////////////////////////////// -->
	<!-- DECRYPTION SERVER                                                   -->
	<!--/////////////////////////////////////////////////////////////////// -->
	<bean id="decryptionServer" class="org.refcodes.cryptography.alt.filesystem.impls.FileSystemDecryptionServerImpl" lazy-init="true">
		<constructor-arg ref="cryptographyFileSystem" />
		<constructor-arg value="${CRYPTOGRAPHY_FILESYSTEM_PATH}"/>
	</bean>
	
	<!--/////////////////////////////////////////////////////////////////// -->
	<!-- DECRYPTION SERVER WRAPPER                                           -->
	<!--/////////////////////////////////////////////////////////////////// -->
	<!-- This configuration is special as it uses not only one key pair for  -->
	<!-- encryption and decryption. It uses one key pair for encrypting the  -->
	<!-- ciphers by the "encryptionService" to be stored by the              -->
	<!-- "encryptionServer" and for decrypting ciphers from the              -->
	<!-- "decryptionServer" by "decryptionServerWrapper".                    -->
	<!-- =================================================================== -->
	<!-- This wrapper also  requires public keys of separate key pairs for   -->
	<!-- encrypting the ciphers requested by a "decryptionService" which has -->
	<!-- an according private key for finally decrypting. There may be cases -->
	<!-- where the second encryption step may be skipped, for such cases the -->
	<!-- wrapper can be omitted as done for the "simple" cryptography        -->
	<!-- context!                                                            -->
	<!--/////////////////////////////////////////////////////////////////// -->
	<bean id="decryptionServerWrapper" class="org.refcodes.cryptography.impls.PublicKeyDecryptionServerWrapperImpl" lazy-init="true">
		<constructor-arg value="${CRYPTOGRAPHY_SERVER_PRIVATE_KEY_PATH}" />
		<constructor-arg value="${CRYPTOGRAPHY_SERVICE_PUBLIC_KEYS_PATH}" />
		<constructor-arg ref="decryptionServer" />
	</bean>
</beans>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy