You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by mowen <mo...@fhlbi.com> on 2015/10/22 15:00:34 UTC

SecurityProvider setup using Bouncycastle

I am trying to use Bouncycastle as the security provider to encrypt passwords
in the config files. I have gone through the steps outlined in the Karaf
Security documentation under "Deploying Security Provider". 

I have the following entry in the blueprint file to set the provider for
Jasypt

	<enc:property-placeholder>
	<enc:encryptor
class="org.jasypt.encryption.pbe.StandardPBEStringEncryptor">
	  <property name="config">
		<bean class="org.jasypt.encryption.pbe.config.SimplePBEConfig">
		  <property name="algorithm" value="PBEWITHSHA256AND256BITAES-CBC-BC"/>
		  <property name="providerClassName"
value="org.bouncycastle.jce.provider.BouncyCastleProvider"/>
		  <property name="password" value="ThisIsThePasswordEncryptionKey"/>
		  <property name="providerName" value="BC"/>
		</bean>
	  </property>
	</enc:encryptor>
    </enc:property-placeholder>

And my bundle appears to have the relevant bundles imported.

Imported Packages	javax.sql,version=0.0.0 from org.apache.felix.framework
(0)
net.sourceforge.jtds.jdbcx,version=0.0.0 from
wrap_mvn_net.sourceforge.jtds_jtds_1.3.0 (238)
oracle.jdbc.pool,version=0.0.0 from wrap_mvn_com.oracle_ojdbc6_11.2.0.2.0
(237)
org.apache.camel,version=2.14.1 from org.apache.camel.camel-core (116)
org.apache.camel.builder,version=2.14.1 from org.apache.camel.camel-core
(116)
org.apache.camel.converter.crypto,version=2.14.1 from
org.apache.camel.camel-crypto (235)
org.apache.camel.model,version=2.14.1 from org.apache.camel.camel-core (116)
org.apache.camel.processor.aggregate,version=2.14.1 from
org.apache.camel.camel-core (116)
org.apache.camel.processor.aggregate.zipfile,version=2.14.1 from
org.apache.camel.camel-zipfile (232)
org.apache.camel.spi,version=2.14.1 from org.apache.camel.camel-core (116)
org.bouncycastle.jce.provider,version=1.53.0 from bcprov (236)
org.jasypt.encryption.pbe,version=1.9.1 from
org.apache.servicemix.bundles.jasypt (96)
org.jasypt.encryption.pbe.config,version=1.9.1 from
org.apache.servicemix.bundles.jasypt (96)
org.osgi.service.blueprint,version=1.0.0 from
org.apache.aries.blueprint.core (18)
org.slf4j,version=1.7.7 from org.ops4j.pax.logging.pax-logging-api (4)
org.slf4j,version=1.7.1 from org.ops4j.pax.logging.pax-logging-api (4)
org.slf4j,version=1.6.6 from org.ops4j.pax.logging.pax-logging-api (4)
org.slf4j,version=1.5.11 from org.ops4j.pax.logging.pax-logging-api (4)
org.slf4j,version=1.4.3 from org.ops4j.pax.logging.pax-logging-api (4)
 
But I still seem to getting the following stack trace when the bundle loads:
rg.osgi.service.blueprint.container.ComponentDefinitionException: Error
setting property: PropertyDescriptor <name: encryptor, getter: class
org.apache.karaf.jaas.jasypt.handler.EncryptablePropertyPlaceholder.getEncryptor(),
setter: [class
org.apache.karaf.jaas.jasypt.handler.EncryptablePropertyPlaceholder.setEncryptor(interface
org.jasypt.encryption.StringEncryptor)]
        at
org.apache.aries.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:941)[18:org.apache.aries.blueprint.core:1.4.2]
        at
org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:907)[18:org.apache.aries.blueprint.core:1.4.2]
        at
org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:888)[18:org.apache.aries.blueprint.core:1.4.2]
        at
org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:820)[18:org.apache.aries.blueprint.core:1.4.2]
        at
org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:787)[18:org.apache.aries.blueprint.core:1.4.2]
        at
org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)[18:org.apache.aries.blueprint.core:1.4.2]
        at
java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_85]
        at
org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)[18:org.apache.aries.blueprint.core:1.4.2]
        at
org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:245)[18:org.apache.aries.blueprint.core:1.4.2]
        at
org.apache.aries.blueprint.container.BlueprintRepository.createInstance(BlueprintRepository.java:230)[18:org.apache.aries.blueprint.core:1.4.2]
        at
org.apache.aries.blueprint.container.BlueprintRepository.create(BlueprintRepository.java:155)[18:org.apache.aries.blueprint.core:1.4.2]
        at
org.apache.aries.blueprint.container.BlueprintContainerImpl.processProcessors(BlueprintContainerImpl.java:528)[18:org.apache.aries.blueprint.core:1.4.2]
        at
org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:361)[18:org.apache.aries.blueprint.core:1.4.2]
        at
org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:269)[18:org.apache.aries.blueprint.core:1.4.2]
        at
org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:294)[18:org.apache.aries.blueprint.core:1.4.2]
        at
org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:263)[18:org.apache.aries.blueprint.core:1.4.2]
        at
org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:253)[18:org.apache.aries.blueprint.core:1.4.2]
        at
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:500)[13:org.apache.aries.util:1.1.0]
        at
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:433)[13:org.apache.aries.util:1.1.0]
        at
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.track(BundleHookBundleTracker.java:725)[13:org.apache.aries.util:1.1.0]
        at
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.bundleChanged(BundleHookBundleTracker.java:463)[13:org.apache.aries.util:1.1.0]
        at
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$BundleEventHook.event(BundleHookBundleTracker.java:422)[13:org.apache.aries.util:1.1.0]
        at
org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(SecureAction.java:1127)[org.apache.felix.framework-4.4.1.jar:]
        at
org.apache.felix.framework.util.EventDispatcher.createWhitelistFromHooks(EventDispatcher.java:696)[org.apache.felix.framework-4.4.1.jar:]
        at
org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:484)[org.apache.felix.framework-4.4.1.jar:]
        at
org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4429)[org.apache.felix.framework-4.4.1.jar:]
        at
org.apache.felix.framework.Felix.startBundle(Felix.java:2100)[org.apache.felix.framework-4.4.1.jar:]
        at
org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1299)[org.apache.felix.framework-4.4.1.jar:]
        at
org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:304)[org.apache.felix.framework-4.4.1.jar:]
        at java.lang.Thread.run(Thread.java:745)[:1.7.0_85]
Caused by: java.lang.Exception: Unable to convert value
org.jasypt.encryption.pbe.StandardPBEStringEncryptor@5a2a9c08 to type
org.jasypt.encryption.StringEncryptor
        at
org.apache.aries.blueprint.container.AggregateConverter.convert(AggregateConverter.java:184)[18:org.apache.aries.blueprint.core:1.4.2]
        at
org.apache.aries.blueprint.container.BlueprintRepository.convert(BlueprintRepository.java:402)[18:org.apache.aries.blueprint.core:1.4.2]
        at
org.apache.aries.blueprint.utils.ReflectionUtils$PropertyDescriptor.convert(ReflectionUtils.java:394)[18:org.apache.aries.blueprint.core:1.4.2]
        at
org.apache.aries.blueprint.utils.ReflectionUtils$MethodPropertyDescriptor.internalSet(ReflectionUtils.java:628)[18:org.apache.aries.blueprint.core:1.4.2]
        at
org.apache.aries.blueprint.utils.ReflectionUtils$PropertyDescriptor.set(ReflectionUtils.java:378)[18:org.apache.aries.blueprint.core:1.4.2]
        at
org.apache.aries.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:939)[18:org.apache.aries.blueprint.core:1.4.2]

Any idea what may be causing this?




--
View this message in context: http://servicemix.396122.n5.nabble.com/SecurityProvider-setup-using-Bouncycastle-tp5723051.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.