You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Patel, Gaurav" <Ga...@amd.com> on 2013/01/24 19:04:27 UTC

Camel-Crypto ElGamal encryption works in mvn camel:run but not in Karaf/OSGi

I have camel 2.10.3 installed and am using the example pubring-ElGamal.gpg from 'components\camel-crypto\src\test\resources\org\apache\camel\component\crypto' in camel-crypto and user 'sdude@nowhere.net'.

When I run the camel route with mvn camel:run, the RSA encryption works perfectly as well as the DSA + ElGamal encryption.  When I move this exact route to Karaf, the RSA encryption continues to work but the DSA + ElGamal gives the following stack trace:

org.bouncycastle.openpgp.PGPException: exception encrypting session key at org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown Source) at org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown Source) at org.apache.camel.converter.crypto.PGPDataFormat.marshal(PGPDataFormat.java:86) at org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.java:59) at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:334) at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220) at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:303) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.Pipeline.process(Pipeline.java:117) at org.apache.camel.processor.Pipeline.process(Pipeline.java:80) at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150) at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117) at org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86) at org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:104) at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:560) at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:498) at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:467) at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325) at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1058) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1050) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:947) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: org.bouncycastle.openpgp.PGPException: exception constructing public key at org.bouncycastle.openpgp.PGPPublicKey.getKey(Unknown Source) at org.bouncycastle.openpgp.PGPEncryptedDataGenerator$PubMethod.addSessionInfo(Unknown Source) ... 46 more Caused by: java.security.spec.InvalidKeySpecException: key spec not recognised at org.bouncycastle.jcajce.provider.asymmetric.util.BaseKeyFactorySpi.engineGeneratePublic(Unknown Source) at org.bouncycastle.jcajce.provider.asymmetric.elgamal.KeyFactorySpi.engineGeneratePublic(Unknown Source) at java.security.KeyFactory.generatePublic(KeyFactory.java:298) ... 48 more

I'm using the jre.properties.cxf (moved to jre.properties) and have this in my config.properties:
# configure karaf security providers
org.apache.karaf.security.providers = org.bouncycastle.jce.provider.BouncyCastleProvider

# javax.transaction is needed to avoid class loader constraint violation when using javax.sql
org.osgi.framework.bootdelegation=org.apache.karaf.jaas.boot,sun.*,com.sun.*,javax.transaction,javax.transaction.*,org.bouncycastle*

I've also loaded bcprov-jdk16-1.46.jar into lib/ext since I'm using Java SDK 1.6.

Any suggestions/ideas on what could be wrong?

Gaurav


Re: Camel-Crypto ElGamal encryption works in mvn camel:run but not in Karaf/OSGi

Posted by Christian Müller <ch...@gmail.com>.
Thanks for sharing your solution Steve. I added the servicemix@ user list
in cc because they provide the osgi bundle and are also interested to get
this fixed.

Best,
Christian
Am 21.08.2013 22:06 schrieb "steve.ardis" <sc...@gmail.com>:

> I've spent a couple days trying to get Fuse 6.0.0 running with Bouncy
> Castle
> via a Camel Crypto route.  Here are my notes on how I finally got this
> working (and some detail as to what I think the problem is):
>
>
> To setup Bouncy Castle on "jboss-fuse-6.0.0.redhat-024":
>
>         1. Download the following files from
> http://www.bouncycastle.org/latest_releases.html
>                 1. bcpg-jdk15on-149.jar
>                 2. bcprov-ext-jdk15on-149.jar
>                 3. bcprov-jdk15on-149.jar
>
>         2. Edit "/etc/config.properties"
>
>                 1. Add ",org.bouncycastle.*" to the end of
> "org.osgi.framework.bootdelegation"
>                 2. Note, it appears that the following two line ARE NOT
> NECESSARY, as
> something else must be registering the BouncyCastleProvider as a security
> provider - but, for documentation purposes, it may be necessary to add ONE
> OF the following two lines:
>
>                         1. org.apache.felix.karaf.security.providers =
> org.bouncycastle.jce.provider.BouncyCastleProvider
>                         2. org.apache.karaf.security.providers =
> org.bouncycastle.jce.provider.BouncyCastleProvider
>
>
> I believe the problem is that the
>
> "/system/org/apache/servicemix/bundles/org.apache.servicemix.bundles.bcpg-jdk16/1.46_2"
> JAR file appears to be screwed up, in that it contains classes that is
> should not.  My guess is 1) that this JAR is not signed and that this is
> the
> first JAR file in the classpath that contains the BouncyCastleProvider;
> BouncyCastleProvider should actually be loaded from the "bcprov" JAR file
> and that JAR is most likely signed - read
> http://www.bouncycastle.org/latest_releases.html, regarding "signed
> jars").
> My understanding is that a security provider class must be in a signed JAR.
>
> If needed, I can elaborate on what I think the problem to be - these were
> just my notes so I didn't forget.  If they are decipherable, let me know.
>
>
> Steve Ardis
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-Crypto-ElGamal-encryption-works-in-mvn-camel-run-but-not-in-Karaf-OSGi-tp5726186p5737697.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: Camel-Crypto ElGamal encryption works in mvn camel:run but not in Karaf/OSGi

Posted by Christian Müller <ch...@gmail.com>.
Thanks for sharing your solution Steve. I added the servicemix@ user list
in cc because they provide the osgi bundle and are also interested to get
this fixed.

Best,
Christian
Am 21.08.2013 22:06 schrieb "steve.ardis" <sc...@gmail.com>:

> I've spent a couple days trying to get Fuse 6.0.0 running with Bouncy
> Castle
> via a Camel Crypto route.  Here are my notes on how I finally got this
> working (and some detail as to what I think the problem is):
>
>
> To setup Bouncy Castle on "jboss-fuse-6.0.0.redhat-024":
>
>         1. Download the following files from
> http://www.bouncycastle.org/latest_releases.html
>                 1. bcpg-jdk15on-149.jar
>                 2. bcprov-ext-jdk15on-149.jar
>                 3. bcprov-jdk15on-149.jar
>
>         2. Edit "/etc/config.properties"
>
>                 1. Add ",org.bouncycastle.*" to the end of
> "org.osgi.framework.bootdelegation"
>                 2. Note, it appears that the following two line ARE NOT
> NECESSARY, as
> something else must be registering the BouncyCastleProvider as a security
> provider - but, for documentation purposes, it may be necessary to add ONE
> OF the following two lines:
>
>                         1. org.apache.felix.karaf.security.providers =
> org.bouncycastle.jce.provider.BouncyCastleProvider
>                         2. org.apache.karaf.security.providers =
> org.bouncycastle.jce.provider.BouncyCastleProvider
>
>
> I believe the problem is that the
>
> "/system/org/apache/servicemix/bundles/org.apache.servicemix.bundles.bcpg-jdk16/1.46_2"
> JAR file appears to be screwed up, in that it contains classes that is
> should not.  My guess is 1) that this JAR is not signed and that this is
> the
> first JAR file in the classpath that contains the BouncyCastleProvider;
> BouncyCastleProvider should actually be loaded from the "bcprov" JAR file
> and that JAR is most likely signed - read
> http://www.bouncycastle.org/latest_releases.html, regarding "signed
> jars").
> My understanding is that a security provider class must be in a signed JAR.
>
> If needed, I can elaborate on what I think the problem to be - these were
> just my notes so I didn't forget.  If they are decipherable, let me know.
>
>
> Steve Ardis
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-Crypto-ElGamal-encryption-works-in-mvn-camel-run-but-not-in-Karaf-OSGi-tp5726186p5737697.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: Camel-Crypto ElGamal encryption works in mvn camel:run but not in Karaf/OSGi

Posted by "steve.ardis" <sc...@gmail.com>.
I've spent a couple days trying to get Fuse 6.0.0 running with Bouncy Castle
via a Camel Crypto route.  Here are my notes on how I finally got this
working (and some detail as to what I think the problem is):


To setup Bouncy Castle on "jboss-fuse-6.0.0.redhat-024":

	1. Download the following files from 
http://www.bouncycastle.org/latest_releases.html
		1. bcpg-jdk15on-149.jar
		2. bcprov-ext-jdk15on-149.jar
		3. bcprov-jdk15on-149.jar

	2. Edit "/etc/config.properties"

		1. Add ",org.bouncycastle.*" to the end of
"org.osgi.framework.bootdelegation"
		2. Note, it appears that the following two line ARE NOT NECESSARY, as
something else must be registering the BouncyCastleProvider as a security
provider - but, for documentation purposes, it may be necessary to add ONE
OF the following two lines:

			1. org.apache.felix.karaf.security.providers =
org.bouncycastle.jce.provider.BouncyCastleProvider
			2. org.apache.karaf.security.providers =
org.bouncycastle.jce.provider.BouncyCastleProvider


I believe the problem is that the
"/system/org/apache/servicemix/bundles/org.apache.servicemix.bundles.bcpg-jdk16/1.46_2"
JAR file appears to be screwed up, in that it contains classes that is
should not.  My guess is 1) that this JAR is not signed and that this is the
first JAR file in the classpath that contains the BouncyCastleProvider;
BouncyCastleProvider should actually be loaded from the "bcprov" JAR file
and that JAR is most likely signed - read 
http://www.bouncycastle.org/latest_releases.html, regarding "signed jars"). 
My understanding is that a security provider class must be in a signed JAR.

If needed, I can elaborate on what I think the problem to be - these were
just my notes so I didn't forget.  If they are decipherable, let me know.


Steve Ardis




--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Crypto-ElGamal-encryption-works-in-mvn-camel-run-but-not-in-Karaf-OSGi-tp5726186p5737697.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel-Crypto ElGamal encryption works in mvn camel:run but not in Karaf/OSGi

Posted by Christian Müller <ch...@gmail.com>.
If I change the dependency from

org.bouncycastle/bcpg-jdk16/1.46 ->
org.apache.servicemix.bundles/org.apache.servicemix.bundles.bcpg-jdk16/1.46_2
and
org.bouncycastle/bcprov-jdk16/1.46 ->
org.apache.servicemix.bundles/org.apache.servicemix.bundles.bcprov-jdk16/1.46_2

in camel-crypto 2.10.4 and run the same test again, I get the same
exception:
org.apache.camel.CamelExecutionException: Exception occurred during
execution on the exchange: Exchange[Message: Hi Alice, Be careful Eve is
listening, signed Bob]
    at
org.apache.camel.util.ObjectHelper.wrapCamelExecutionException(ObjectHelper.java:1332)
    at
org.apache.camel.util.ExchangeHelper.extractResultBody(ExchangeHelper.java:618)
    at
org.apache.camel.impl.DefaultProducerTemplate.extractResultBody(DefaultProducerTemplate.java:454)
    at
org.apache.camel.impl.DefaultProducerTemplate.extractResultBody(DefaultProducerTemplate.java:450)
    at
org.apache.camel.impl.DefaultProducerTemplate.sendBodyAndHeaders(DefaultProducerTemplate.java:230)
    at
org.apache.camel.impl.DefaultProducerTemplate.sendBodyAndHeaders(DefaultProducerTemplate.java:216)
    at
org.apache.camel.converter.crypto.AbstractPGPDataFormatTest.doRoundTripEncryptionTests(AbstractPGPDataFormatTest.java:35)
    at
org.apache.camel.converter.crypto.PGPDataFormatTest.testEncryption(PGPDataFormatTest.java:36)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
    at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
    at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
    at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
    at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:47)
    at org.junit.rules.RunRules.evaluate(RunRules.java:18)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
    at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
    at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
    at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
    at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
    at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.bouncycastle.openpgp.PGPException: exception encrypting
session key
    at org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown
Source)
    at org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown
Source)
    at
org.apache.camel.converter.crypto.PGPDataFormat.marshal(PGPDataFormat.java:86)
    at
org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.java:59)
    at
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
    at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
    at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
    at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
    at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)
    at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
    at
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:334)
    at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220)
    at
org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)
    at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
    at
org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:308)
    at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:117)
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
    at
org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)
    at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
    at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:122)
    at
org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)
    at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
    at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
    at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
    at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
    at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
    at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
    at
org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:61)
    at
org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)
    at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)
    at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)
    at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86)
    at
org.apache.camel.processor.UnitOfWorkProducer.process(UnitOfWorkProducer.java:63)
    at
org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:366)
    at
org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:1)
    at
org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:233)
    at
org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:337)
    at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:175)
    at
org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:111)
    at
org.apache.camel.impl.DefaultProducerTemplate.sendBodyAndHeaders(DefaultProducerTemplate.java:220)
    ... 31 more
Caused by: java.lang.SecurityException: JCE cannot authenticate the
provider BC
    at javax.crypto.Cipher.getInstance(DashoA13*..)
    at
org.bouncycastle.openpgp.PGPEncryptedDataGenerator$PubMethod.addSessionInfo(Unknown
Source)
    ... 72 more
Caused by: java.util.jar.JarException: Cannot parse
file:/Users/cmueller/.m2/repository/org/apache/servicemix/bundles/org.apache.servicemix.bundles.bcpg-jdk16/1.46_2/org.apache.servicemix.bundles.bcpg-jdk16-1.46_2.jar
    at javax.crypto.SunJCE_c.a(DashoA13*..)
    at javax.crypto.SunJCE_b.b(DashoA13*..)
    at javax.crypto.SunJCE_b.a(DashoA13*..)
    ... 74 more

Will contact the ServiceMix guys which provide the bundles...

Best,
Christian


On Tue, Apr 2, 2013 at 11:02 PM, Christian Müller <
christian.mueller@gmail.com> wrote:

> UPDATE:
>
> I use Java 1.6.0_43 for the following:
>
> cmueller$ cd workspaceCamel/camel/components/camel-crypto/
>
> remove the @Ignore annotation on
> org.apache.camel.converter.crypto.PGPDataFormatElGamalTest.java
>
> cmueller$ mvn clean test -Dtest=PGPDataFormatElGamalTest
> ...
> Tests run: 3, Failures: 0, Errors: 0, Skipped: 0
>
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO]
> ------------------------------------------------------------------------
>
> This makes sure the used JDK supports the strong encryption.
>
>
>
> cp pubring-ElGamal.gpg ${KARAF_HOME}/etc/pubring-ElGamal.gpg
>
> and start Karaf 2.2.10:
>
> cmueller$ ./karaf clean
> karaf@root> features:chooseurl camel 2.10.4
> adding feature url
> mvn:org.apache.camel.karaf/apache-camel/2.10.4/xml/features
> karaf@root> features:install camel-spring
> karaf@root> features:install camel-crypto
> karaf@root> install -s
> mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.bcprov-jdk16/1.46_2
>
> Update the keyFileName property in context.xml (attached) so it matches
> your environment.
>
> cp context.xml ${KARAF_HOME}/deploy/context.xml
>
> But I got the following exception:
>
> org.bouncycastle.openpgp.PGPException: exception encrypting session key
>     at org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown
> Source)[77:org.apache.servicemix.bundles.bcpg-jdk16:1.46.0.2]
>     at org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown
> Source)[77:org.apache.servicemix.bundles.bcpg-jdk16:1.46.0.2]
>     at
> org.apache.camel.converter.crypto.PGPDataFormat.marshal(PGPDataFormat.java:86)[78:org.apache.camel.camel-crypto:2.10.4]
>     at
> org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.java:59)[71:org.apache.camel.camel-core:2.10.4]
>     at
> org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)[71:org.apache.camel.camel-core:2.10.4]
>     at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[71:org.apache.camel.camel-core:2.10.4]
>     at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[71:org.apache.camel.camel-core:2.10.4]
>     at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[71:org.apache.camel.camel-core:2.10.4]
>     at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)[71:org.apache.camel.camel-core:2.10.4]
>     at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[71:org.apache.camel.camel-core:2.10.4]
>     at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[71:org.apache.camel.camel-core:2.10.4]
>     at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[71:org.apache.camel.camel-core:2.10.4]
>     at
> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)[71:org.apache.camel.camel-core:2.10.4]
>     at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[71:org.apache.camel.camel-core:2.10.4]
>     at
> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:334)[71:org.apache.camel.camel-core:2.10.4]
>     at
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220)[71:org.apache.camel.camel-core:2.10.4]
>     at
> org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)[71:org.apache.camel.camel-core:2.10.4]
>     at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[71:org.apache.camel.camel-core:2.10.4]
>     at
> org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:308)[71:org.apache.camel.camel-core:2.10.4]
>     at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[71:org.apache.camel.camel-core:2.10.4]
>     at
> org.apache.camel.processor.Pipeline.process(Pipeline.java:117)[71:org.apache.camel.camel-core:2.10.4]
>     at
> org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[71:org.apache.camel.camel-core:2.10.4]
>     at
> org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)[71:org.apache.camel.camel-core:2.10.4]
>     at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[71:org.apache.camel.camel-core:2.10.4]
>     at
> org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)[71:org.apache.camel.camel-core:2.10.4]
>     at
> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)[71:org.apache.camel.camel-core:2.10.4]
>     at
> org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)[71:org.apache.camel.camel-core:2.10.4]
>     at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[71:org.apache.camel.camel-core:2.10.4]
>     at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[71:org.apache.camel.camel-core:2.10.4]
>     at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[71:org.apache.camel.camel-core:2.10.4]
>     at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[71:org.apache.camel.camel-core:2.10.4]
>     at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)[71:org.apache.camel.camel-core:2.10.4]
>     at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)[71:org.apache.camel.camel-core:2.10.4]
>     at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86)[71:org.apache.camel.camel-core:2.10.4]
>     at
> org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:135)[71:org.apache.camel.camel-core:2.10.4]
>     at
> org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:63)[71:org.apache.camel.camel-core:2.10.4]
>     at java.util.TimerThread.mainLoop(Timer.java:512)[:1.6.0_43]
>     at java.util.TimerThread.run(Timer.java:462)[:1.6.0_43]
> Caused by: java.lang.SecurityException: JCE cannot authenticate the
> provider BC
>     at javax.crypto.Cipher.getInstance(DashoA13*..)[:1.6]
>     at
> org.bouncycastle.openpgp.PGPEncryptedDataGenerator$PubMethod.addSessionInfo(Unknown
> Source)[77:org.apache.servicemix.bundles.bcpg-jdk16:1.46.0.2]
>     ... 38 more
> Caused by: java.util.jar.JarException: Cannot parse
> mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.bcpg-jdk16/1.46_2
>     at javax.crypto.SunJCE_c.a(DashoA13*..)[:1.6]
>     at javax.crypto.SunJCE_b.b(DashoA13*..)[:1.6]
>     at javax.crypto.SunJCE_b.a(DashoA13*..)[:1.6]
>     ... 40 more
>
> Will dig further into it...
>
> Best,
> Christian
>
>
>
> On Tue, Feb 5, 2013 at 9:07 PM, Christian Müller <
> christian.mueller@gmail.com> wrote:
>
>> Still on my to do list...
>>
>> Sent from a mobile device
>> Am 05.02.2013 00:07 schrieb "Patel, Gaurav" <Ga...@amd.com>:
>>
>> Was anyone able to reproduce?
>>>
>>> I've run the scenario on ServiceMix, Karaf + Camel and FuseESB (linux
>>> and windows) all to the same effect: no key spec.  I've even tried
>>> installing Bouncy Castle and the unlimited security policy against my
>>> JDK/JRE and not putting anything into Karaf/lib/ext and nothing changes.
>>>  Should I ask this question to the Karaf DL instead of the Camel one?
>>>
>>> Gaurav
>>>
>>>
>>> -----Original Message-----
>>> From: Christian Müller [mailto:christian.mueller@gmail.com]
>>> Sent: Monday, January 28, 2013 5:30 PM
>>> To: users@camel.apache.org
>>> Subject: Re: Camel-Crypto ElGamal encryption works in mvn camel:run but
>>> not in Karaf/OSGi
>>>
>>> I'm trying to reproduce the issue...
>>>
>>> Best,
>>> Christian
>>>
>>> On Mon, Jan 28, 2013 at 5:38 PM, Patel, Gaurav <Ga...@amd.com>
>>> wrote:
>>>
>>> > Karaf version 2.2.10
>>> > Camel 2.10.3
>>> >
>>> > What's odd to me is that a certain types of keys work in Karaf but the
>>> > other ones do not.  It's not a complete failure where I can't get
>>> > camel-crypto working on Karaf, just ElGamal keys.
>>> >
>>> > Is there a way I can setup debug logging to see what the error is
>>> > beyond the stack trace?
>>> >
>>> > Gaurav
>>> >
>>> >
>>> > -----Original Message-----
>>> > From: Claus Ibsen [mailto:claus.ibsen@gmail.com]
>>> > Sent: Saturday, January 26, 2013 4:26 AM
>>> > To: users@camel.apache.org
>>> > Subject: Re: Camel-Crypto ElGamal encryption works in mvn camel:run
>>> > but not in Karaf/OSGi
>>> >
>>> > Hi
>>> >
>>> > You should tell which Karaf version you use.
>>> > But OSGi can be tricky to get working.
>>> >
>>> >
>>> > On Thu, Jan 24, 2013 at 7:04 PM, Patel, Gaurav <Ga...@amd.com>
>>> > wrote:
>>> > > I have camel 2.10.3 installed and am using the example
>>> > pubring-ElGamal.gpg from
>>> >
>>> 'components\camel-crypto\src\test\resources\org\apache\camel\component\crypto'
>>> > in camel-crypto and user 'sdude@nowhere.net'.
>>> > >
>>> > > When I run the camel route with mvn camel:run, the RSA encryption
>>> > > works
>>> > perfectly as well as the DSA + ElGamal encryption.  When I move this
>>> > exact route to Karaf, the RSA encryption continues to work but the DSA
>>> > + ElGamal gives the following stack trace:
>>> > >
>>> > > org.bouncycastle.openpgp.PGPException: exception encrypting session
>>> > > key
>>> > at org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown
>>> > Source) at
>>> > org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown
>>> > Source) at
>>> > org.apache.camel.converter.crypto.PGPDataFormat.marshal(PGPDataFormat.
>>> > java:86)
>>> > at
>>> > org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.j
>>> > ava:59)
>>> > at
>>> > org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncPr
>>> > ocessorBridge.process(AsyncProcessorConverterHelper.java:61)
>>> > at
>>> > org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelpe
>>> > r.java:73)
>>> > at
>>> > org.apache.camel.processor.DelegateAsyncProcessor.processNext(Delegate
>>> > AsyncProcessor.java:99)
>>> > at
>>> > org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyn
>>> > cProcessor.java:90)
>>> > at
>>> > org.apache.camel.management.InstrumentationProcessor.process(Instrumen
>>> > tationProcessor.java:73)
>>> > at
>>> > org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelpe
>>> > r.java:73)
>>> > at
>>> > org.apache.camel.processor.DelegateAsyncProcessor.processNext(Delegate
>>> > AsyncProcessor.java:99)
>>> > at
>>> > org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyn
>>> > cProcessor.java:90)
>>> > at
>>> > org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceI
>>> > nterceptor.java:91)
>>> > at
>>> > org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelpe
>>> > r.java:73)
>>> > at
>>> > org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(
>>> > RedeliveryErrorHandler.java:334)
>>> > at
>>> > org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryEr
>>> > rorHandler.java:220)
>>> > at
>>> > org.apache.camel.processor.RouteContextProcessor.processNext(RouteCont
>>> > extProcessor.java:45)
>>> > at
>>> > org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyn
>>> > cProcessor.java:90)
>>> > at
>>> > org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultC
>>> > hannel.java:303)
>>> > at
>>> > org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelpe
>>> > r.java:73) at
>>> > org.apache.camel.processor.Pipeline.process(Pipeline.java:117) at
>>> > org.apache.camel.processor.Pipeline.process(Pipeline.java:80) at
>>> > org.apache.camel.processor.RouteContextProcessor.processNext(RouteCont
>>> > extProcessor.java:45)
>>> > at
>>> > org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyn
>>> > cProcessor.java:90)
>>> > at
>>> > org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWork
>>> > Processor.java:150)
>>> > at
>>> > org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProce
>>> > ssor.java:117)
>>> > at
>>> > org.apache.camel.processor.RouteInflightRepositoryProcessor.processNex
>>> > t(RouteInflightRepositoryProcessor.java:48)
>>> > at
>>> > org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyn
>>> > cProcessor.java:90)
>>> > at
>>> > org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelpe
>>> > r.java:73)
>>> > at
>>> > org.apache.camel.processor.DelegateAsyncProcessor.processNext(Delegate
>>> > AsyncProcessor.java:99)
>>> > at
>>> > org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyn
>>> > cProcessor.java:90)
>>> > at
>>> > org.apache.camel.management.InstrumentationProcessor.process(Instrumen
>>> > tationProcessor.java:73)
>>> > at
>>> > org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelpe
>>> > r.java:99)
>>> > at
>>> > org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyn
>>> > cProcessor.java:86)
>>> > at
>>> > org.apache.camel.component.jms.EndpointMessageListener.onMessage(Endpo
>>> > intMessageListener.java:104)
>>> > at
>>> > org.springframework.jms.listener.AbstractMessageListenerContainer.doIn
>>> > vokeListener(AbstractMessageListenerContainer.java:560)
>>> > at
>>> > org.springframework.jms.listener.AbstractMessageListenerContainer.invo
>>> > keListener(AbstractMessageListenerContainer.java:498)
>>> > at
>>> > org.springframework.jms.listener.AbstractMessageListenerContainer.doEx
>>> > ecuteListener(AbstractMessageListenerContainer.java:467)
>>> > at
>>> > org.springframework.jms.listener.AbstractPollingMessageListenerContain
>>> > er.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:32
>>> > 5)
>>> > at
>>> > org.springframework.jms.listener.AbstractPollingMessageListenerContain
>>> > er.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263)
>>> > at
>>> > org.springframework.jms.listener.DefaultMessageListenerContainer$Async
>>> > MessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.
>>> > java:1058)
>>> > at
>>> > org.springframework.jms.listener.DefaultMessageListenerContainer$Async
>>> > MessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContai
>>> > ner.java:1050)
>>> > at
>>> > org.springframework.jms.listener.DefaultMessageListenerContainer$Async
>>> > MessageListenerInvoker.run(DefaultMessageListenerContainer.java:947)
>>> > at
>>> > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecu
>>> > tor.java:886)
>>> > at
>>> > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.
>>> > java:908) at java.lang.Thread.run(Thread.java:662) Caused by:
>>> > org.bouncycastle.openpgp.PGPException: exception constructing public
>>> > key at org.bouncycastle.openpgp.PGPPublicKey.getKey(Unknown Source) at
>>> > org.bouncycastle.openpgp.PGPEncryptedDataGenerator$PubMethod.addSessio
>>> > nInfo(Unknown
>>> > Source) ... 46 more Caused by:
>>> java.security.spec.InvalidKeySpecException:
>>> > key spec not recognised at
>>> > org.bouncycastle.jcajce.provider.asymmetric.util.BaseKeyFactorySpi.eng
>>> > ineGeneratePublic(Unknown
>>> > Source) at
>>> > org.bouncycastle.jcajce.provider.asymmetric.elgamal.KeyFactorySpi.engi
>>> > neGeneratePublic(Unknown
>>> > Source) at
>>> java.security.KeyFactory.generatePublic(KeyFactory.java:298) ...
>>> > 48 more
>>> > >
>>> > > I'm using the jre.properties.cxf (moved to jre.properties) and have
>>> > > this
>>> > in my config.properties:
>>> > > # configure karaf security providers
>>> > > org.apache.karaf.security.providers =
>>> > org.bouncycastle.jce.provider.BouncyCastleProvider
>>> > >
>>> > > # javax.transaction is needed to avoid class loader constraint
>>> > > violation
>>> > when using javax.sql
>>> > >
>>> > org.osgi.framework.bootdelegation=org.apache.karaf.jaas.boot,sun.*,com
>>> > .sun.*,javax.transaction,javax.transaction.*,org.bouncycastle*
>>> > >
>>> > > I've also loaded bcprov-jdk16-1.46.jar into lib/ext since I'm using
>>> > > Java
>>> > SDK 1.6.
>>> > >
>>> > > Any suggestions/ideas on what could be wrong?
>>> > >
>>> > > Gaurav
>>> > >
>>> >
>>> >
>>> >
>>> > --
>>> > Claus Ibsen
>>> > -----------------
>>> > Red Hat, Inc.
>>> > FuseSource is now part of Red Hat
>>> > Email: cibsen@redhat.com
>>> > Web: http://fusesource.com
>>> > Twitter: davsclaus
>>> > Blog: http://davsclaus.com
>>> > Author of Camel in Action: http://www.manning.com/ibsen
>>> >
>>> >
>>> >
>>>
>>>
>>> --
>>>
>>>
>

Re: Camel-Crypto ElGamal encryption works in mvn camel:run but not in Karaf/OSGi

Posted by Christian Müller <ch...@gmail.com>.
UPDATE:

I use Java 1.6.0_43 for the following:

cmueller$ cd workspaceCamel/camel/components/camel-crypto/

remove the @Ignore annotation on
org.apache.camel.converter.crypto.PGPDataFormatElGamalTest.java

cmueller$ mvn clean test -Dtest=PGPDataFormatElGamalTest
...
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0

[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO]
------------------------------------------------------------------------

This makes sure the used JDK supports the strong encryption.



cp pubring-ElGamal.gpg ${KARAF_HOME}/etc/pubring-ElGamal.gpg

and start Karaf 2.2.10:

cmueller$ ./karaf clean
karaf@root> features:chooseurl camel 2.10.4
adding feature url
mvn:org.apache.camel.karaf/apache-camel/2.10.4/xml/features
karaf@root> features:install camel-spring
karaf@root> features:install camel-crypto
karaf@root> install -s
mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.bcprov-jdk16/1.46_2

Update the keyFileName property in context.xml (attached) so it matches
your environment.

cp context.xml ${KARAF_HOME}/deploy/context.xml

But I got the following exception:
org.bouncycastle.openpgp.PGPException: exception encrypting session key
    at org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown
Source)[77:org.apache.servicemix.bundles.bcpg-jdk16:1.46.0.2]
    at org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown
Source)[77:org.apache.servicemix.bundles.bcpg-jdk16:1.46.0.2]
    at
org.apache.camel.converter.crypto.PGPDataFormat.marshal(PGPDataFormat.java:86)[78:org.apache.camel.camel-crypto:2.10.4]
    at
org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.java:59)[71:org.apache.camel.camel-core:2.10.4]
    at
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)[71:org.apache.camel.camel-core:2.10.4]
    at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[71:org.apache.camel.camel-core:2.10.4]
    at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[71:org.apache.camel.camel-core:2.10.4]
    at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[71:org.apache.camel.camel-core:2.10.4]
    at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)[71:org.apache.camel.camel-core:2.10.4]
    at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[71:org.apache.camel.camel-core:2.10.4]
    at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[71:org.apache.camel.camel-core:2.10.4]
    at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[71:org.apache.camel.camel-core:2.10.4]
    at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)[71:org.apache.camel.camel-core:2.10.4]
    at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[71:org.apache.camel.camel-core:2.10.4]
    at
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:334)[71:org.apache.camel.camel-core:2.10.4]
    at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220)[71:org.apache.camel.camel-core:2.10.4]
    at
org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)[71:org.apache.camel.camel-core:2.10.4]
    at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[71:org.apache.camel.camel-core:2.10.4]
    at
org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:308)[71:org.apache.camel.camel-core:2.10.4]
    at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[71:org.apache.camel.camel-core:2.10.4]
    at
org.apache.camel.processor.Pipeline.process(Pipeline.java:117)[71:org.apache.camel.camel-core:2.10.4]
    at
org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[71:org.apache.camel.camel-core:2.10.4]
    at
org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)[71:org.apache.camel.camel-core:2.10.4]
    at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[71:org.apache.camel.camel-core:2.10.4]
    at
org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)[71:org.apache.camel.camel-core:2.10.4]
    at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)[71:org.apache.camel.camel-core:2.10.4]
    at
org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)[71:org.apache.camel.camel-core:2.10.4]
    at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[71:org.apache.camel.camel-core:2.10.4]
    at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[71:org.apache.camel.camel-core:2.10.4]
    at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[71:org.apache.camel.camel-core:2.10.4]
    at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[71:org.apache.camel.camel-core:2.10.4]
    at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)[71:org.apache.camel.camel-core:2.10.4]
    at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)[71:org.apache.camel.camel-core:2.10.4]
    at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86)[71:org.apache.camel.camel-core:2.10.4]
    at
org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:135)[71:org.apache.camel.camel-core:2.10.4]
    at
org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:63)[71:org.apache.camel.camel-core:2.10.4]
    at java.util.TimerThread.mainLoop(Timer.java:512)[:1.6.0_43]
    at java.util.TimerThread.run(Timer.java:462)[:1.6.0_43]
Caused by: java.lang.SecurityException: JCE cannot authenticate the
provider BC
    at javax.crypto.Cipher.getInstance(DashoA13*..)[:1.6]
    at
org.bouncycastle.openpgp.PGPEncryptedDataGenerator$PubMethod.addSessionInfo(Unknown
Source)[77:org.apache.servicemix.bundles.bcpg-jdk16:1.46.0.2]
    ... 38 more
Caused by: java.util.jar.JarException: Cannot parse
mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.bcpg-jdk16/1.46_2
    at javax.crypto.SunJCE_c.a(DashoA13*..)[:1.6]
    at javax.crypto.SunJCE_b.b(DashoA13*..)[:1.6]
    at javax.crypto.SunJCE_b.a(DashoA13*..)[:1.6]
    ... 40 more

Will dig further into it...

Best,
Christian



On Tue, Feb 5, 2013 at 9:07 PM, Christian Müller <
christian.mueller@gmail.com> wrote:

> Still on my to do list...
>
> Sent from a mobile device
> Am 05.02.2013 00:07 schrieb "Patel, Gaurav" <Ga...@amd.com>:
>
> Was anyone able to reproduce?
>>
>> I've run the scenario on ServiceMix, Karaf + Camel and FuseESB (linux and
>> windows) all to the same effect: no key spec.  I've even tried installing
>> Bouncy Castle and the unlimited security policy against my JDK/JRE and not
>> putting anything into Karaf/lib/ext and nothing changes.  Should I ask this
>> question to the Karaf DL instead of the Camel one?
>>
>> Gaurav
>>
>>
>> -----Original Message-----
>> From: Christian Müller [mailto:christian.mueller@gmail.com]
>> Sent: Monday, January 28, 2013 5:30 PM
>> To: users@camel.apache.org
>> Subject: Re: Camel-Crypto ElGamal encryption works in mvn camel:run but
>> not in Karaf/OSGi
>>
>> I'm trying to reproduce the issue...
>>
>> Best,
>> Christian
>>
>> On Mon, Jan 28, 2013 at 5:38 PM, Patel, Gaurav <Ga...@amd.com>
>> wrote:
>>
>> > Karaf version 2.2.10
>> > Camel 2.10.3
>> >
>> > What's odd to me is that a certain types of keys work in Karaf but the
>> > other ones do not.  It's not a complete failure where I can't get
>> > camel-crypto working on Karaf, just ElGamal keys.
>> >
>> > Is there a way I can setup debug logging to see what the error is
>> > beyond the stack trace?
>> >
>> > Gaurav
>> >
>> >
>> > -----Original Message-----
>> > From: Claus Ibsen [mailto:claus.ibsen@gmail.com]
>> > Sent: Saturday, January 26, 2013 4:26 AM
>> > To: users@camel.apache.org
>> > Subject: Re: Camel-Crypto ElGamal encryption works in mvn camel:run
>> > but not in Karaf/OSGi
>> >
>> > Hi
>> >
>> > You should tell which Karaf version you use.
>> > But OSGi can be tricky to get working.
>> >
>> >
>> > On Thu, Jan 24, 2013 at 7:04 PM, Patel, Gaurav <Ga...@amd.com>
>> > wrote:
>> > > I have camel 2.10.3 installed and am using the example
>> > pubring-ElGamal.gpg from
>> >
>> 'components\camel-crypto\src\test\resources\org\apache\camel\component\crypto'
>> > in camel-crypto and user 'sdude@nowhere.net'.
>> > >
>> > > When I run the camel route with mvn camel:run, the RSA encryption
>> > > works
>> > perfectly as well as the DSA + ElGamal encryption.  When I move this
>> > exact route to Karaf, the RSA encryption continues to work but the DSA
>> > + ElGamal gives the following stack trace:
>> > >
>> > > org.bouncycastle.openpgp.PGPException: exception encrypting session
>> > > key
>> > at org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown
>> > Source) at
>> > org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown
>> > Source) at
>> > org.apache.camel.converter.crypto.PGPDataFormat.marshal(PGPDataFormat.
>> > java:86)
>> > at
>> > org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.j
>> > ava:59)
>> > at
>> > org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncPr
>> > ocessorBridge.process(AsyncProcessorConverterHelper.java:61)
>> > at
>> > org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelpe
>> > r.java:73)
>> > at
>> > org.apache.camel.processor.DelegateAsyncProcessor.processNext(Delegate
>> > AsyncProcessor.java:99)
>> > at
>> > org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyn
>> > cProcessor.java:90)
>> > at
>> > org.apache.camel.management.InstrumentationProcessor.process(Instrumen
>> > tationProcessor.java:73)
>> > at
>> > org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelpe
>> > r.java:73)
>> > at
>> > org.apache.camel.processor.DelegateAsyncProcessor.processNext(Delegate
>> > AsyncProcessor.java:99)
>> > at
>> > org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyn
>> > cProcessor.java:90)
>> > at
>> > org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceI
>> > nterceptor.java:91)
>> > at
>> > org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelpe
>> > r.java:73)
>> > at
>> > org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(
>> > RedeliveryErrorHandler.java:334)
>> > at
>> > org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryEr
>> > rorHandler.java:220)
>> > at
>> > org.apache.camel.processor.RouteContextProcessor.processNext(RouteCont
>> > extProcessor.java:45)
>> > at
>> > org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyn
>> > cProcessor.java:90)
>> > at
>> > org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultC
>> > hannel.java:303)
>> > at
>> > org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelpe
>> > r.java:73) at
>> > org.apache.camel.processor.Pipeline.process(Pipeline.java:117) at
>> > org.apache.camel.processor.Pipeline.process(Pipeline.java:80) at
>> > org.apache.camel.processor.RouteContextProcessor.processNext(RouteCont
>> > extProcessor.java:45)
>> > at
>> > org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyn
>> > cProcessor.java:90)
>> > at
>> > org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWork
>> > Processor.java:150)
>> > at
>> > org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProce
>> > ssor.java:117)
>> > at
>> > org.apache.camel.processor.RouteInflightRepositoryProcessor.processNex
>> > t(RouteInflightRepositoryProcessor.java:48)
>> > at
>> > org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyn
>> > cProcessor.java:90)
>> > at
>> > org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelpe
>> > r.java:73)
>> > at
>> > org.apache.camel.processor.DelegateAsyncProcessor.processNext(Delegate
>> > AsyncProcessor.java:99)
>> > at
>> > org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyn
>> > cProcessor.java:90)
>> > at
>> > org.apache.camel.management.InstrumentationProcessor.process(Instrumen
>> > tationProcessor.java:73)
>> > at
>> > org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelpe
>> > r.java:99)
>> > at
>> > org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyn
>> > cProcessor.java:86)
>> > at
>> > org.apache.camel.component.jms.EndpointMessageListener.onMessage(Endpo
>> > intMessageListener.java:104)
>> > at
>> > org.springframework.jms.listener.AbstractMessageListenerContainer.doIn
>> > vokeListener(AbstractMessageListenerContainer.java:560)
>> > at
>> > org.springframework.jms.listener.AbstractMessageListenerContainer.invo
>> > keListener(AbstractMessageListenerContainer.java:498)
>> > at
>> > org.springframework.jms.listener.AbstractMessageListenerContainer.doEx
>> > ecuteListener(AbstractMessageListenerContainer.java:467)
>> > at
>> > org.springframework.jms.listener.AbstractPollingMessageListenerContain
>> > er.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:32
>> > 5)
>> > at
>> > org.springframework.jms.listener.AbstractPollingMessageListenerContain
>> > er.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263)
>> > at
>> > org.springframework.jms.listener.DefaultMessageListenerContainer$Async
>> > MessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.
>> > java:1058)
>> > at
>> > org.springframework.jms.listener.DefaultMessageListenerContainer$Async
>> > MessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContai
>> > ner.java:1050)
>> > at
>> > org.springframework.jms.listener.DefaultMessageListenerContainer$Async
>> > MessageListenerInvoker.run(DefaultMessageListenerContainer.java:947)
>> > at
>> > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecu
>> > tor.java:886)
>> > at
>> > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.
>> > java:908) at java.lang.Thread.run(Thread.java:662) Caused by:
>> > org.bouncycastle.openpgp.PGPException: exception constructing public
>> > key at org.bouncycastle.openpgp.PGPPublicKey.getKey(Unknown Source) at
>> > org.bouncycastle.openpgp.PGPEncryptedDataGenerator$PubMethod.addSessio
>> > nInfo(Unknown
>> > Source) ... 46 more Caused by:
>> java.security.spec.InvalidKeySpecException:
>> > key spec not recognised at
>> > org.bouncycastle.jcajce.provider.asymmetric.util.BaseKeyFactorySpi.eng
>> > ineGeneratePublic(Unknown
>> > Source) at
>> > org.bouncycastle.jcajce.provider.asymmetric.elgamal.KeyFactorySpi.engi
>> > neGeneratePublic(Unknown
>> > Source) at java.security.KeyFactory.generatePublic(KeyFactory.java:298)
>> ...
>> > 48 more
>> > >
>> > > I'm using the jre.properties.cxf (moved to jre.properties) and have
>> > > this
>> > in my config.properties:
>> > > # configure karaf security providers
>> > > org.apache.karaf.security.providers =
>> > org.bouncycastle.jce.provider.BouncyCastleProvider
>> > >
>> > > # javax.transaction is needed to avoid class loader constraint
>> > > violation
>> > when using javax.sql
>> > >
>> > org.osgi.framework.bootdelegation=org.apache.karaf.jaas.boot,sun.*,com
>> > .sun.*,javax.transaction,javax.transaction.*,org.bouncycastle*
>> > >
>> > > I've also loaded bcprov-jdk16-1.46.jar into lib/ext since I'm using
>> > > Java
>> > SDK 1.6.
>> > >
>> > > Any suggestions/ideas on what could be wrong?
>> > >
>> > > Gaurav
>> > >
>> >
>> >
>> >
>> > --
>> > Claus Ibsen
>> > -----------------
>> > Red Hat, Inc.
>> > FuseSource is now part of Red Hat
>> > Email: cibsen@redhat.com
>> > Web: http://fusesource.com
>> > Twitter: davsclaus
>> > Blog: http://davsclaus.com
>> > Author of Camel in Action: http://www.manning.com/ibsen
>> >
>> >
>> >
>>
>>
>> --
>>
>>

RE: Camel-Crypto ElGamal encryption works in mvn camel:run but not in Karaf/OSGi

Posted by Christian Müller <ch...@gmail.com>.
Still on my to do list...

Sent from a mobile device
Am 05.02.2013 00:07 schrieb "Patel, Gaurav" <Ga...@amd.com>:

> Was anyone able to reproduce?
>
> I've run the scenario on ServiceMix, Karaf + Camel and FuseESB (linux and
> windows) all to the same effect: no key spec.  I've even tried installing
> Bouncy Castle and the unlimited security policy against my JDK/JRE and not
> putting anything into Karaf/lib/ext and nothing changes.  Should I ask this
> question to the Karaf DL instead of the Camel one?
>
> Gaurav
>
>
> -----Original Message-----
> From: Christian Müller [mailto:christian.mueller@gmail.com]
> Sent: Monday, January 28, 2013 5:30 PM
> To: users@camel.apache.org
> Subject: Re: Camel-Crypto ElGamal encryption works in mvn camel:run but
> not in Karaf/OSGi
>
> I'm trying to reproduce the issue...
>
> Best,
> Christian
>
> On Mon, Jan 28, 2013 at 5:38 PM, Patel, Gaurav <Ga...@amd.com>
> wrote:
>
> > Karaf version 2.2.10
> > Camel 2.10.3
> >
> > What's odd to me is that a certain types of keys work in Karaf but the
> > other ones do not.  It's not a complete failure where I can't get
> > camel-crypto working on Karaf, just ElGamal keys.
> >
> > Is there a way I can setup debug logging to see what the error is
> > beyond the stack trace?
> >
> > Gaurav
> >
> >
> > -----Original Message-----
> > From: Claus Ibsen [mailto:claus.ibsen@gmail.com]
> > Sent: Saturday, January 26, 2013 4:26 AM
> > To: users@camel.apache.org
> > Subject: Re: Camel-Crypto ElGamal encryption works in mvn camel:run
> > but not in Karaf/OSGi
> >
> > Hi
> >
> > You should tell which Karaf version you use.
> > But OSGi can be tricky to get working.
> >
> >
> > On Thu, Jan 24, 2013 at 7:04 PM, Patel, Gaurav <Ga...@amd.com>
> > wrote:
> > > I have camel 2.10.3 installed and am using the example
> > pubring-ElGamal.gpg from
> >
> 'components\camel-crypto\src\test\resources\org\apache\camel\component\crypto'
> > in camel-crypto and user 'sdude@nowhere.net'.
> > >
> > > When I run the camel route with mvn camel:run, the RSA encryption
> > > works
> > perfectly as well as the DSA + ElGamal encryption.  When I move this
> > exact route to Karaf, the RSA encryption continues to work but the DSA
> > + ElGamal gives the following stack trace:
> > >
> > > org.bouncycastle.openpgp.PGPException: exception encrypting session
> > > key
> > at org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown
> > Source) at
> > org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown
> > Source) at
> > org.apache.camel.converter.crypto.PGPDataFormat.marshal(PGPDataFormat.
> > java:86)
> > at
> > org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.j
> > ava:59)
> > at
> > org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncPr
> > ocessorBridge.process(AsyncProcessorConverterHelper.java:61)
> > at
> > org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelpe
> > r.java:73)
> > at
> > org.apache.camel.processor.DelegateAsyncProcessor.processNext(Delegate
> > AsyncProcessor.java:99)
> > at
> > org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyn
> > cProcessor.java:90)
> > at
> > org.apache.camel.management.InstrumentationProcessor.process(Instrumen
> > tationProcessor.java:73)
> > at
> > org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelpe
> > r.java:73)
> > at
> > org.apache.camel.processor.DelegateAsyncProcessor.processNext(Delegate
> > AsyncProcessor.java:99)
> > at
> > org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyn
> > cProcessor.java:90)
> > at
> > org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceI
> > nterceptor.java:91)
> > at
> > org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelpe
> > r.java:73)
> > at
> > org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(
> > RedeliveryErrorHandler.java:334)
> > at
> > org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryEr
> > rorHandler.java:220)
> > at
> > org.apache.camel.processor.RouteContextProcessor.processNext(RouteCont
> > extProcessor.java:45)
> > at
> > org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyn
> > cProcessor.java:90)
> > at
> > org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultC
> > hannel.java:303)
> > at
> > org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelpe
> > r.java:73) at
> > org.apache.camel.processor.Pipeline.process(Pipeline.java:117) at
> > org.apache.camel.processor.Pipeline.process(Pipeline.java:80) at
> > org.apache.camel.processor.RouteContextProcessor.processNext(RouteCont
> > extProcessor.java:45)
> > at
> > org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyn
> > cProcessor.java:90)
> > at
> > org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWork
> > Processor.java:150)
> > at
> > org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProce
> > ssor.java:117)
> > at
> > org.apache.camel.processor.RouteInflightRepositoryProcessor.processNex
> > t(RouteInflightRepositoryProcessor.java:48)
> > at
> > org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyn
> > cProcessor.java:90)
> > at
> > org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelpe
> > r.java:73)
> > at
> > org.apache.camel.processor.DelegateAsyncProcessor.processNext(Delegate
> > AsyncProcessor.java:99)
> > at
> > org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyn
> > cProcessor.java:90)
> > at
> > org.apache.camel.management.InstrumentationProcessor.process(Instrumen
> > tationProcessor.java:73)
> > at
> > org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelpe
> > r.java:99)
> > at
> > org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyn
> > cProcessor.java:86)
> > at
> > org.apache.camel.component.jms.EndpointMessageListener.onMessage(Endpo
> > intMessageListener.java:104)
> > at
> > org.springframework.jms.listener.AbstractMessageListenerContainer.doIn
> > vokeListener(AbstractMessageListenerContainer.java:560)
> > at
> > org.springframework.jms.listener.AbstractMessageListenerContainer.invo
> > keListener(AbstractMessageListenerContainer.java:498)
> > at
> > org.springframework.jms.listener.AbstractMessageListenerContainer.doEx
> > ecuteListener(AbstractMessageListenerContainer.java:467)
> > at
> > org.springframework.jms.listener.AbstractPollingMessageListenerContain
> > er.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:32
> > 5)
> > at
> > org.springframework.jms.listener.AbstractPollingMessageListenerContain
> > er.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263)
> > at
> > org.springframework.jms.listener.DefaultMessageListenerContainer$Async
> > MessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.
> > java:1058)
> > at
> > org.springframework.jms.listener.DefaultMessageListenerContainer$Async
> > MessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContai
> > ner.java:1050)
> > at
> > org.springframework.jms.listener.DefaultMessageListenerContainer$Async
> > MessageListenerInvoker.run(DefaultMessageListenerContainer.java:947)
> > at
> > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecu
> > tor.java:886)
> > at
> > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.
> > java:908) at java.lang.Thread.run(Thread.java:662) Caused by:
> > org.bouncycastle.openpgp.PGPException: exception constructing public
> > key at org.bouncycastle.openpgp.PGPPublicKey.getKey(Unknown Source) at
> > org.bouncycastle.openpgp.PGPEncryptedDataGenerator$PubMethod.addSessio
> > nInfo(Unknown
> > Source) ... 46 more Caused by:
> java.security.spec.InvalidKeySpecException:
> > key spec not recognised at
> > org.bouncycastle.jcajce.provider.asymmetric.util.BaseKeyFactorySpi.eng
> > ineGeneratePublic(Unknown
> > Source) at
> > org.bouncycastle.jcajce.provider.asymmetric.elgamal.KeyFactorySpi.engi
> > neGeneratePublic(Unknown
> > Source) at java.security.KeyFactory.generatePublic(KeyFactory.java:298)
> ...
> > 48 more
> > >
> > > I'm using the jre.properties.cxf (moved to jre.properties) and have
> > > this
> > in my config.properties:
> > > # configure karaf security providers
> > > org.apache.karaf.security.providers =
> > org.bouncycastle.jce.provider.BouncyCastleProvider
> > >
> > > # javax.transaction is needed to avoid class loader constraint
> > > violation
> > when using javax.sql
> > >
> > org.osgi.framework.bootdelegation=org.apache.karaf.jaas.boot,sun.*,com
> > .sun.*,javax.transaction,javax.transaction.*,org.bouncycastle*
> > >
> > > I've also loaded bcprov-jdk16-1.46.jar into lib/ext since I'm using
> > > Java
> > SDK 1.6.
> > >
> > > Any suggestions/ideas on what could be wrong?
> > >
> > > Gaurav
> > >
> >
> >
> >
> > --
> > Claus Ibsen
> > -----------------
> > Red Hat, Inc.
> > FuseSource is now part of Red Hat
> > Email: cibsen@redhat.com
> > Web: http://fusesource.com
> > Twitter: davsclaus
> > Blog: http://davsclaus.com
> > Author of Camel in Action: http://www.manning.com/ibsen
> >
> >
> >
>
>
> --
>
>

RE: Camel-Crypto ElGamal encryption works in mvn camel:run but not in Karaf/OSGi

Posted by "Patel, Gaurav" <Ga...@amd.com>.
Was anyone able to reproduce?

I've run the scenario on ServiceMix, Karaf + Camel and FuseESB (linux and windows) all to the same effect: no key spec.  I've even tried installing Bouncy Castle and the unlimited security policy against my JDK/JRE and not putting anything into Karaf/lib/ext and nothing changes.  Should I ask this question to the Karaf DL instead of the Camel one?

Gaurav


-----Original Message-----
From: Christian Müller [mailto:christian.mueller@gmail.com] 
Sent: Monday, January 28, 2013 5:30 PM
To: users@camel.apache.org
Subject: Re: Camel-Crypto ElGamal encryption works in mvn camel:run but not in Karaf/OSGi

I'm trying to reproduce the issue...

Best,
Christian

On Mon, Jan 28, 2013 at 5:38 PM, Patel, Gaurav <Ga...@amd.com> wrote:

> Karaf version 2.2.10
> Camel 2.10.3
>
> What's odd to me is that a certain types of keys work in Karaf but the 
> other ones do not.  It's not a complete failure where I can't get 
> camel-crypto working on Karaf, just ElGamal keys.
>
> Is there a way I can setup debug logging to see what the error is 
> beyond the stack trace?
>
> Gaurav
>
>
> -----Original Message-----
> From: Claus Ibsen [mailto:claus.ibsen@gmail.com]
> Sent: Saturday, January 26, 2013 4:26 AM
> To: users@camel.apache.org
> Subject: Re: Camel-Crypto ElGamal encryption works in mvn camel:run 
> but not in Karaf/OSGi
>
> Hi
>
> You should tell which Karaf version you use.
> But OSGi can be tricky to get working.
>
>
> On Thu, Jan 24, 2013 at 7:04 PM, Patel, Gaurav <Ga...@amd.com>
> wrote:
> > I have camel 2.10.3 installed and am using the example
> pubring-ElGamal.gpg from
> 'components\camel-crypto\src\test\resources\org\apache\camel\component\crypto'
> in camel-crypto and user 'sdude@nowhere.net'.
> >
> > When I run the camel route with mvn camel:run, the RSA encryption 
> > works
> perfectly as well as the DSA + ElGamal encryption.  When I move this 
> exact route to Karaf, the RSA encryption continues to work but the DSA 
> + ElGamal gives the following stack trace:
> >
> > org.bouncycastle.openpgp.PGPException: exception encrypting session 
> > key
> at org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown 
> Source) at 
> org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown 
> Source) at
> org.apache.camel.converter.crypto.PGPDataFormat.marshal(PGPDataFormat.
> java:86)
> at
> org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.j
> ava:59)
> at
> org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncPr
> ocessorBridge.process(AsyncProcessorConverterHelper.java:61)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelpe
> r.java:73)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(Delegate
> AsyncProcessor.java:99)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyn
> cProcessor.java:90)
> at
> org.apache.camel.management.InstrumentationProcessor.process(Instrumen
> tationProcessor.java:73)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelpe
> r.java:73)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(Delegate
> AsyncProcessor.java:99)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyn
> cProcessor.java:90)
> at
> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceI
> nterceptor.java:91)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelpe
> r.java:73)
> at
> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(
> RedeliveryErrorHandler.java:334)
> at
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryEr
> rorHandler.java:220)
> at
> org.apache.camel.processor.RouteContextProcessor.processNext(RouteCont
> extProcessor.java:45)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyn
> cProcessor.java:90)
> at
> org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultC
> hannel.java:303)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelpe
> r.java:73) at 
> org.apache.camel.processor.Pipeline.process(Pipeline.java:117) at
> org.apache.camel.processor.Pipeline.process(Pipeline.java:80) at
> org.apache.camel.processor.RouteContextProcessor.processNext(RouteCont
> extProcessor.java:45)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyn
> cProcessor.java:90)
> at
> org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWork
> Processor.java:150)
> at
> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProce
> ssor.java:117)
> at
> org.apache.camel.processor.RouteInflightRepositoryProcessor.processNex
> t(RouteInflightRepositoryProcessor.java:48)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyn
> cProcessor.java:90)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelpe
> r.java:73)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(Delegate
> AsyncProcessor.java:99)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyn
> cProcessor.java:90)
> at
> org.apache.camel.management.InstrumentationProcessor.process(Instrumen
> tationProcessor.java:73)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelpe
> r.java:99)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyn
> cProcessor.java:86)
> at
> org.apache.camel.component.jms.EndpointMessageListener.onMessage(Endpo
> intMessageListener.java:104)
> at
> org.springframework.jms.listener.AbstractMessageListenerContainer.doIn
> vokeListener(AbstractMessageListenerContainer.java:560)
> at
> org.springframework.jms.listener.AbstractMessageListenerContainer.invo
> keListener(AbstractMessageListenerContainer.java:498)
> at
> org.springframework.jms.listener.AbstractMessageListenerContainer.doEx
> ecuteListener(AbstractMessageListenerContainer.java:467)
> at
> org.springframework.jms.listener.AbstractPollingMessageListenerContain
> er.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:32
> 5)
> at
> org.springframework.jms.listener.AbstractPollingMessageListenerContain
> er.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263)
> at
> org.springframework.jms.listener.DefaultMessageListenerContainer$Async
> MessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.
> java:1058)
> at
> org.springframework.jms.listener.DefaultMessageListenerContainer$Async
> MessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContai
> ner.java:1050)
> at
> org.springframework.jms.listener.DefaultMessageListenerContainer$Async
> MessageListenerInvoker.run(DefaultMessageListenerContainer.java:947)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecu
> tor.java:886)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.
> java:908) at java.lang.Thread.run(Thread.java:662) Caused by:
> org.bouncycastle.openpgp.PGPException: exception constructing public 
> key at org.bouncycastle.openpgp.PGPPublicKey.getKey(Unknown Source) at 
> org.bouncycastle.openpgp.PGPEncryptedDataGenerator$PubMethod.addSessio
> nInfo(Unknown
> Source) ... 46 more Caused by: java.security.spec.InvalidKeySpecException:
> key spec not recognised at
> org.bouncycastle.jcajce.provider.asymmetric.util.BaseKeyFactorySpi.eng
> ineGeneratePublic(Unknown
> Source) at
> org.bouncycastle.jcajce.provider.asymmetric.elgamal.KeyFactorySpi.engi
> neGeneratePublic(Unknown
> Source) at java.security.KeyFactory.generatePublic(KeyFactory.java:298) ...
> 48 more
> >
> > I'm using the jre.properties.cxf (moved to jre.properties) and have 
> > this
> in my config.properties:
> > # configure karaf security providers 
> > org.apache.karaf.security.providers =
> org.bouncycastle.jce.provider.BouncyCastleProvider
> >
> > # javax.transaction is needed to avoid class loader constraint 
> > violation
> when using javax.sql
> >
> org.osgi.framework.bootdelegation=org.apache.karaf.jaas.boot,sun.*,com
> .sun.*,javax.transaction,javax.transaction.*,org.bouncycastle*
> >
> > I've also loaded bcprov-jdk16-1.46.jar into lib/ext since I'm using 
> > Java
> SDK 1.6.
> >
> > Any suggestions/ideas on what could be wrong?
> >
> > Gaurav
> >
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Email: cibsen@redhat.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
>
>
>


--


Re: Camel-Crypto ElGamal encryption works in mvn camel:run but not in Karaf/OSGi

Posted by Christian Müller <ch...@gmail.com>.
I'm trying to reproduce the issue...

Best,
Christian

On Mon, Jan 28, 2013 at 5:38 PM, Patel, Gaurav <Ga...@amd.com> wrote:

> Karaf version 2.2.10
> Camel 2.10.3
>
> What's odd to me is that a certain types of keys work in Karaf but the
> other ones do not.  It's not a complete failure where I can't get
> camel-crypto working on Karaf, just ElGamal keys.
>
> Is there a way I can setup debug logging to see what the error is beyond
> the stack trace?
>
> Gaurav
>
>
> -----Original Message-----
> From: Claus Ibsen [mailto:claus.ibsen@gmail.com]
> Sent: Saturday, January 26, 2013 4:26 AM
> To: users@camel.apache.org
> Subject: Re: Camel-Crypto ElGamal encryption works in mvn camel:run but
> not in Karaf/OSGi
>
> Hi
>
> You should tell which Karaf version you use.
> But OSGi can be tricky to get working.
>
>
> On Thu, Jan 24, 2013 at 7:04 PM, Patel, Gaurav <Ga...@amd.com>
> wrote:
> > I have camel 2.10.3 installed and am using the example
> pubring-ElGamal.gpg from
> 'components\camel-crypto\src\test\resources\org\apache\camel\component\crypto'
> in camel-crypto and user 'sdude@nowhere.net'.
> >
> > When I run the camel route with mvn camel:run, the RSA encryption works
> perfectly as well as the DSA + ElGamal encryption.  When I move this exact
> route to Karaf, the RSA encryption continues to work but the DSA + ElGamal
> gives the following stack trace:
> >
> > org.bouncycastle.openpgp.PGPException: exception encrypting session key
> at org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown Source)
> at org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown Source)
> at
> org.apache.camel.converter.crypto.PGPDataFormat.marshal(PGPDataFormat.java:86)
> at
> org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.java:59)
> at
> org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
> at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
> at
> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
> at
> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:334)
> at
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220)
> at
> org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
> at
> org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:303)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
> at org.apache.camel.processor.Pipeline.process(Pipeline.java:117) at
> org.apache.camel.processor.Pipeline.process(Pipeline.java:80) at
> org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
> at
> org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)
> at
> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)
> at
> org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
> at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86)
> at
> org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:104)
> at
> org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:560)
> at
> org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:498)
> at
> org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:467)
> at
> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325)
> at
> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263)
> at
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1058)
> at
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1050)
> at
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:947)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:662) Caused by:
> org.bouncycastle.openpgp.PGPException: exception constructing public key at
> org.bouncycastle.openpgp.PGPPublicKey.getKey(Unknown Source) at
> org.bouncycastle.openpgp.PGPEncryptedDataGenerator$PubMethod.addSessionInfo(Unknown
> Source) ... 46 more Caused by: java.security.spec.InvalidKeySpecException:
> key spec not recognised at
> org.bouncycastle.jcajce.provider.asymmetric.util.BaseKeyFactorySpi.engineGeneratePublic(Unknown
> Source) at
> org.bouncycastle.jcajce.provider.asymmetric.elgamal.KeyFactorySpi.engineGeneratePublic(Unknown
> Source) at java.security.KeyFactory.generatePublic(KeyFactory.java:298) ...
> 48 more
> >
> > I'm using the jre.properties.cxf (moved to jre.properties) and have this
> in my config.properties:
> > # configure karaf security providers
> > org.apache.karaf.security.providers =
> org.bouncycastle.jce.provider.BouncyCastleProvider
> >
> > # javax.transaction is needed to avoid class loader constraint violation
> when using javax.sql
> >
> org.osgi.framework.bootdelegation=org.apache.karaf.jaas.boot,sun.*,com.sun.*,javax.transaction,javax.transaction.*,org.bouncycastle*
> >
> > I've also loaded bcprov-jdk16-1.46.jar into lib/ext since I'm using Java
> SDK 1.6.
> >
> > Any suggestions/ideas on what could be wrong?
> >
> > Gaurav
> >
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Email: cibsen@redhat.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
>
>
>


--

RE: Camel-Crypto ElGamal encryption works in mvn camel:run but not in Karaf/OSGi

Posted by "Patel, Gaurav" <Ga...@amd.com>.
Karaf version 2.2.10
Camel 2.10.3

What's odd to me is that a certain types of keys work in Karaf but the other ones do not.  It's not a complete failure where I can't get camel-crypto working on Karaf, just ElGamal keys.

Is there a way I can setup debug logging to see what the error is beyond the stack trace?

Gaurav


-----Original Message-----
From: Claus Ibsen [mailto:claus.ibsen@gmail.com] 
Sent: Saturday, January 26, 2013 4:26 AM
To: users@camel.apache.org
Subject: Re: Camel-Crypto ElGamal encryption works in mvn camel:run but not in Karaf/OSGi

Hi

You should tell which Karaf version you use.
But OSGi can be tricky to get working.


On Thu, Jan 24, 2013 at 7:04 PM, Patel, Gaurav <Ga...@amd.com> wrote:
> I have camel 2.10.3 installed and am using the example pubring-ElGamal.gpg from 'components\camel-crypto\src\test\resources\org\apache\camel\component\crypto' in camel-crypto and user 'sdude@nowhere.net'.
>
> When I run the camel route with mvn camel:run, the RSA encryption works perfectly as well as the DSA + ElGamal encryption.  When I move this exact route to Karaf, the RSA encryption continues to work but the DSA + ElGamal gives the following stack trace:
>
> org.bouncycastle.openpgp.PGPException: exception encrypting session key at org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown Source) at org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown Source) at org.apache.camel.converter.crypto.PGPDataFormat.marshal(PGPDataFormat.java:86) at org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.java:59) at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:334) at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220) at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:303) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.Pipeline.process(Pipeline.java:117) at org.apache.camel.processor.Pipeline.process(Pipeline.java:80) at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150) at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117) at org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86) at org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:104) at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:560) at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:498) at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:467) at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325) at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1058) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1050) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:947) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: org.bouncycastle.openpgp.PGPException: exception constructing public key at org.bouncycastle.openpgp.PGPPublicKey.getKey(Unknown Source) at org.bouncycastle.openpgp.PGPEncryptedDataGenerator$PubMethod.addSessionInfo(Unknown Source) ... 46 more Caused by: java.security.spec.InvalidKeySpecException: key spec not recognised at org.bouncycastle.jcajce.provider.asymmetric.util.BaseKeyFactorySpi.engineGeneratePublic(Unknown Source) at org.bouncycastle.jcajce.provider.asymmetric.elgamal.KeyFactorySpi.engineGeneratePublic(Unknown Source) at java.security.KeyFactory.generatePublic(KeyFactory.java:298) ... 48 more
>
> I'm using the jre.properties.cxf (moved to jre.properties) and have this in my config.properties:
> # configure karaf security providers
> org.apache.karaf.security.providers = org.bouncycastle.jce.provider.BouncyCastleProvider
>
> # javax.transaction is needed to avoid class loader constraint violation when using javax.sql
> org.osgi.framework.bootdelegation=org.apache.karaf.jaas.boot,sun.*,com.sun.*,javax.transaction,javax.transaction.*,org.bouncycastle*
>
> I've also loaded bcprov-jdk16-1.46.jar into lib/ext since I'm using Java SDK 1.6.
>
> Any suggestions/ideas on what could be wrong?
>
> Gaurav
>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen



Re: Camel-Crypto ElGamal encryption works in mvn camel:run but not in Karaf/OSGi

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

You should tell which Karaf version you use.
But OSGi can be tricky to get working.


On Thu, Jan 24, 2013 at 7:04 PM, Patel, Gaurav <Ga...@amd.com> wrote:
> I have camel 2.10.3 installed and am using the example pubring-ElGamal.gpg from 'components\camel-crypto\src\test\resources\org\apache\camel\component\crypto' in camel-crypto and user 'sdude@nowhere.net'.
>
> When I run the camel route with mvn camel:run, the RSA encryption works perfectly as well as the DSA + ElGamal encryption.  When I move this exact route to Karaf, the RSA encryption continues to work but the DSA + ElGamal gives the following stack trace:
>
> org.bouncycastle.openpgp.PGPException: exception encrypting session key at org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown Source) at org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown Source) at org.apache.camel.converter.crypto.PGPDataFormat.marshal(PGPDataFormat.java:86) at org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.java:59) at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:334) at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220) at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:303) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.Pipeline.process(Pipeline.java:117) at org.apache.camel.processor.Pipeline.process(Pipeline.java:80) at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150) at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117) at org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86) at org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:104) at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:560) at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:498) at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:467) at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325) at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1058) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1050) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:947) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: org.bouncycastle.openpgp.PGPException: exception constructing public key at org.bouncycastle.openpgp.PGPPublicKey.getKey(Unknown Source) at org.bouncycastle.openpgp.PGPEncryptedDataGenerator$PubMethod.addSessionInfo(Unknown Source) ... 46 more Caused by: java.security.spec.InvalidKeySpecException: key spec not recognised at org.bouncycastle.jcajce.provider.asymmetric.util.BaseKeyFactorySpi.engineGeneratePublic(Unknown Source) at org.bouncycastle.jcajce.provider.asymmetric.elgamal.KeyFactorySpi.engineGeneratePublic(Unknown Source) at java.security.KeyFactory.generatePublic(KeyFactory.java:298) ... 48 more
>
> I'm using the jre.properties.cxf (moved to jre.properties) and have this in my config.properties:
> # configure karaf security providers
> org.apache.karaf.security.providers = org.bouncycastle.jce.provider.BouncyCastleProvider
>
> # javax.transaction is needed to avoid class loader constraint violation when using javax.sql
> org.osgi.framework.bootdelegation=org.apache.karaf.jaas.boot,sun.*,com.sun.*,javax.transaction,javax.transaction.*,org.bouncycastle*
>
> I've also loaded bcprov-jdk16-1.46.jar into lib/ext since I'm using Java SDK 1.6.
>
> Any suggestions/ideas on what could be wrong?
>
> Gaurav
>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

RE: Camel-Crypto ElGamal encryption works in mvn camel:run but not in Karaf/OSGi

Posted by "Patel, Gaurav" <Ga...@amd.com>.
I've put the following in my lib/ext and tried with neither working:

	bcpg-jdk16-1.46 and bcprov-jdk16-1.46	(retrieved from ~/.m2/repository/org/bouncycastle as this was the version that works with camel:run)
	bcpg-jdk15on-147 and bcprov-jdk15on-147 (downloaded from bouncy castle website)

Also, the stack trace has changed with the different versions.

For 147:
	java.security.spec.InvalidKeySpecException: key spec not recognized
	org.bouncycastle.openpgp.PGPException: exception constructing public key

and 146:
	java.security.spec.InvalidKeySpecException: Unknown KeySpec type: org.bouncycastle.jce.spec.ElGamalPublicKeySpec
	org.bouncycastle.openpgp.PGPException: exception constructing public key

For both versions, ElGamal still does not work but RSA works perfectly.

Gaurav

-----Original Message-----
From: Claus Ibsen [mailto:claus.ibsen@gmail.com] 
Sent: Tuesday, January 29, 2013 3:12 AM
To: users@camel.apache.org
Subject: Re: Camel-Crypto ElGamal encryption works in mvn camel:run but not in Karaf/OSGi

On Tue, Jan 29, 2013 at 3:26 AM, Willem jiang <wi...@gmail.com> wrote:
> I just checked the dependency of camel-crypto, it just use 
> bcprov-jdk15on jar,
>

The -jdk15on name is AFAIR the naming for JDK 1.5 onwards. Eg also 1.6 and 1.7 But he can check the bouncycastle website to be sure.


> <dependency>
> <groupId>org.bouncycastle</groupId>
> <artifactId>bcpg-jdk15on</artifactId>
> <version>${bouncycastle-version}</version>
> </dependency>
> <dependency>
> <groupId>org.bouncycastle</groupId>
> <artifactId>bcprov-jdk15on</artifactId>
> <version>${bouncycastle-version}</version>
> </dependency>
>
>
>
> The version is 1.47.
> I also checked the website[1], it doesn't has the release of bcprov-jdk16-xxx.jar.
>
> Can you try to put that on in your lib/ext directly.
>
> [1]http://www.bouncycastle.org/latest_releases.html
> --
> Willem Jiang
>
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Web: http://www.fusesource.com | http://www.redhat.com
> Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
>           http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
> Twitter: willemjiang
> Weibo: 姜宁willem
>
>
> Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
>
>
> On Friday, January 25, 2013 at 2:04 AM, Patel, Gaurav wrote:
>
>> I have camel 2.10.3 installed and am using the example pubring-ElGamal.gpg from 'components\camel-crypto\src\test\resources\org\apache\camel\component\crypto' in camel-crypto and user 'sdude@nowhere.net (mailto:sdude@nowhere.net)'.
>>
>> When I run the camel route with mvn camel:run, the RSA encryption works perfectly as well as the DSA + ElGamal encryption. When I move this exact route to Karaf, the RSA encryption continues to work but the DSA + ElGamal gives the following stack trace:
>>
>> org.bouncycastle.openpgp.PGPException: exception encrypting session 
>> key at 
>> org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown 
>> Source) at 
>> org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown 
>> Source) at 
>> org.apache.camel.converter.crypto.PGPDataFormat.marshal(PGPDataFormat
>> .java:86) at 
>> org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.
>> java:59) at 
>> org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncP
>> rocessorBridge.process(AsyncProcessorConverterHelper.java:61) at 
>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
>> er.java:73) at 
>> org.apache.camel.processor.DelegateAsyncProcessor.processNext(Delegat
>> eAsyncProcessor.java:99) at 
>> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
>> ncProcessor.java:90) at 
>> org.apache.camel.management.InstrumentationProcessor.process(Instrume
>> ntationProcessor.java:73) at 
>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
>> er.java:73) at 
>> org.apache.camel.processor.DelegateAsyncProcessor.processNext(Delegat
>> eAsyncProcessor.java:99) at 
>> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
>> ncProcessor.java:90) at 
>> org.apache.camel.processor.interceptor.TraceInterceptor.process(Trace
>> Interceptor.java:91) at 
>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
>> er.java:73) at 
>> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler
>> (RedeliveryErrorHandler.java:334) at 
>> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryE
>> rrorHandler.java:220) at 
>> org.apache.camel.processor.RouteContextProcessor.processNext(RouteCon
>> textProcessor.java:45) at 
>> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
>> ncProcessor.java:90) at 
>> org.apache.camel.processor.interceptor.DefaultChannel.process(Default
>> Channel.java:303) at 
>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
>> er.java:73) at 
>> org.apache.camel.processor.Pipeline.process(Pipeline.java:117) at 
>> org.apache.camel.processor.Pipeline.process(Pipeline.java:80) at 
>> org.apache.camel.processor.RouteContextProcessor.processNext(RouteCon
>> textProcessor.java:45) at 
>> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
>> ncProcessor.java:90) at 
>> org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWor
>> kProcessor.java:150) at 
>> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProc
>> essor.java:117) at 
>> org.apache.camel.processor.RouteInflightRepositoryProcessor.processNe
>> xt(RouteInflightRepositoryProcessor.java:48) at 
>> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
>> ncProcessor.java:90) at 
>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
>> er.java:73) at 
>> org.apache.camel.processor.DelegateAsyncProcessor.processNext(Delegat
>> eAsyncProcessor.java:99) at 
>> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
>> ncProcessor.java:90) at 
>> org.apache.camel.management.InstrumentationProcessor.process(Instrume
>> ntationProcessor.java:73) at 
>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
>> er.java:99) at 
>> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
>> ncProcessor.java:86) at 
>> org.apache.camel.component.jms.EndpointMessageListener.onMessage(Endp
>> ointMessageListener.java:104) at 
>> org.springframework.jms.listener.AbstractMessageListenerContainer.doI
>> nvokeListener(AbstractMessageListenerContainer.java:560) at 
>> org.springframework.jms.listener.AbstractMessageListenerContainer.inv
>> okeListener(AbstractMessageListenerContainer.java:498) at 
>> org.springframework.jms.listener.AbstractMessageListenerContainer.doE
>> xecuteListener(AbstractMessageListenerContainer.java:467) at 
>> org.springframework.jms.listener.AbstractPollingMessageListenerContai
>> ner.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:
>> 325) at 
>> org.springframework.jms.listener.AbstractPollingMessageListenerContai
>> ner.receiveAndExecute(AbstractPollingMessageListenerContainer.java:26
>> 3) at 
>> org.springframework.jms.listener.DefaultMessageListenerContainer$Asyn
>> cMessageListenerInvoker.invokeListener(DefaultMessageListenerContaine
>> r.java:1058) at 
>> org.springframework.jms.listener.DefaultMessageListenerContainer$Asyn
>> cMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerCont
>> ainer.java:1050) at 
>> org.springframework.jms.listener.DefaultMessageListenerContainer$Asyn
>> cMessageListenerInvoker.run(DefaultMessageListenerContainer.java:947) 
>> at 
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
>> utor.java:886) at 
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
>> .java:908) at java.lang.Thread.run(Thread.java:662) Caused by: 
>> org.bouncycastle.openpgp.PGPException: exception constructing public 
>> key at org.bouncycastle.openpgp.PGPPublicKey.getKey(Unknown Source) 
>> at 
>> org.bouncycastle.openpgp.PGPEncryptedDataGenerator$PubMethod.addSessi
>> onInfo(Unknown Source) ... 46 more Caused by: 
>> java.security.spec.InvalidKeySpecException: key spec not recognised 
>> at 
>> org.bouncycastle.jcajce.provider.asymmetric.util.BaseKeyFactorySpi.en
>> gineGeneratePublic(Unknown Source) at 
>> org.bouncycastle.jcajce.provider.asymmetric.elgamal.KeyFactorySpi.eng
>> ineGeneratePublic(Unknown Source) at 
>> java.security.KeyFactory.generatePublic(KeyFactory.java:298) ... 48 
>> more
>>
>> I'm using the jre.properties.cxf (moved to jre.properties) and have this in my config.properties:
>> # configure karaf security providers
>> org.apache.karaf.security.providers = 
>> org.bouncycastle.jce.provider.BouncyCastleProvider
>>
>> # javax.transaction is needed to avoid class loader constraint 
>> violation when using javax.sql
>> org.osgi.framework.bootdelegation=org.apache.karaf.jaas.boot,sun.*,co
>> m.sun.*,javax.transaction,javax.transaction.*,org.bouncycastle*
>>
>> I've also loaded bcprov-jdk16-1.46.jar into lib/ext since I'm using Java SDK 1.6.
>>
>> Any suggestions/ideas on what could be wrong?
>>
>> Gaurav
>
>



--
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Camel-Crypto ElGamal encryption works in mvn camel:run but not in Karaf/OSGi

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Jan 29, 2013 at 3:26 AM, Willem jiang <wi...@gmail.com> wrote:
> I just checked the dependency of camel-crypto, it just use bcprov-jdk15on jar,
>

The -jdk15on name is AFAIR the naming for JDK 1.5 onwards. Eg also 1.6 and 1.7
But he can check the bouncycastle website to be sure.


> <dependency>
> <groupId>org.bouncycastle</groupId>
> <artifactId>bcpg-jdk15on</artifactId>
> <version>${bouncycastle-version}</version>
> </dependency>
> <dependency>
> <groupId>org.bouncycastle</groupId>
> <artifactId>bcprov-jdk15on</artifactId>
> <version>${bouncycastle-version}</version>
> </dependency>
>
>
>
> The version is 1.47.
> I also checked the website[1], it doesn't has the release of bcprov-jdk16-xxx.jar.
>
> Can you try to put that on in your lib/ext directly.
>
> [1]http://www.bouncycastle.org/latest_releases.html
> --
> Willem Jiang
>
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Web: http://www.fusesource.com | http://www.redhat.com
> Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
>           http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
> Twitter: willemjiang
> Weibo: 姜宁willem
>
>
> Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
>
>
> On Friday, January 25, 2013 at 2:04 AM, Patel, Gaurav wrote:
>
>> I have camel 2.10.3 installed and am using the example pubring-ElGamal.gpg from 'components\camel-crypto\src\test\resources\org\apache\camel\component\crypto' in camel-crypto and user 'sdude@nowhere.net (mailto:sdude@nowhere.net)'.
>>
>> When I run the camel route with mvn camel:run, the RSA encryption works perfectly as well as the DSA + ElGamal encryption. When I move this exact route to Karaf, the RSA encryption continues to work but the DSA + ElGamal gives the following stack trace:
>>
>> org.bouncycastle.openpgp.PGPException: exception encrypting session key at org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown Source) at org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown Source) at org.apache.camel.converter.crypto.PGPDataFormat.marshal(PGPDataFormat.java:86) at org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.java:59) at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:334) at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220) at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:303) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.Pipeline.process(Pipeline.java:117) at org.apache.camel.processor.Pipeline.process(Pipeline.java:80) at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150) at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117) at org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86) at org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:104) at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:560) at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:498) at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:467) at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325) at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1058) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1050) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:947) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: org.bouncycastle.openpgp.PGPException: exception constructing public key at org.bouncycastle.openpgp.PGPPublicKey.getKey(Unknown Source) at org.bouncycastle.openpgp.PGPEncryptedDataGenerator$PubMethod.addSessionInfo(Unknown Source) ... 46 more Caused by: java.security.spec.InvalidKeySpecException: key spec not recognised at org.bouncycastle.jcajce.provider.asymmetric.util.BaseKeyFactorySpi.engineGeneratePublic(Unknown Source) at org.bouncycastle.jcajce.provider.asymmetric.elgamal.KeyFactorySpi.engineGeneratePublic(Unknown Source) at java.security.KeyFactory.generatePublic(KeyFactory.java:298) ... 48 more
>>
>> I'm using the jre.properties.cxf (moved to jre.properties) and have this in my config.properties:
>> # configure karaf security providers
>> org.apache.karaf.security.providers = org.bouncycastle.jce.provider.BouncyCastleProvider
>>
>> # javax.transaction is needed to avoid class loader constraint violation when using javax.sql
>> org.osgi.framework.bootdelegation=org.apache.karaf.jaas.boot,sun.*,com.sun.*,javax.transaction,javax.transaction.*,org.bouncycastle*
>>
>> I've also loaded bcprov-jdk16-1.46.jar into lib/ext since I'm using Java SDK 1.6.
>>
>> Any suggestions/ideas on what could be wrong?
>>
>> Gaurav
>
>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Camel-Crypto ElGamal encryption works in mvn camel:run but not in Karaf/OSGi

Posted by Christian Müller <ch...@gmail.com>.
For Camel 2.10.3 it's the right dependency.

Sent from a mobile device
Am 29.01.2013 03:27 schrieb "Willem jiang" <wi...@gmail.com>:

> I just checked the dependency of camel-crypto, it just use bcprov-jdk15on
> jar,
>
> <dependency>
> <groupId>org.bouncycastle</groupId>
> <artifactId>bcpg-jdk15on</artifactId>
> <version>${bouncycastle-version}</version>
> </dependency>
> <dependency>
> <groupId>org.bouncycastle</groupId>
> <artifactId>bcprov-jdk15on</artifactId>
> <version>${bouncycastle-version}</version>
> </dependency>
>
>
>
> The version is 1.47.
> I also checked the website[1], it doesn't has the release of
> bcprov-jdk16-xxx.jar.
>
> Can you try to put that on in your lib/ext directly.
>
> [1]http://www.bouncycastle.org/latest_releases.html
> --
> Willem Jiang
>
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Web: http://www.fusesource.com | http://www.redhat.com
> Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/)
> (English)
>           http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
> Twitter: willemjiang
> Weibo: 姜宁willem
>
>
> Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
>
>
> On Friday, January 25, 2013 at 2:04 AM, Patel, Gaurav wrote:
>
> > I have camel 2.10.3 installed and am using the example
> pubring-ElGamal.gpg from
> 'components\camel-crypto\src\test\resources\org\apache\camel\component\crypto'
> in camel-crypto and user 'sdude@nowhere.net (mailto:sdude@nowhere.net)'.
> >
> > When I run the camel route with mvn camel:run, the RSA encryption works
> perfectly as well as the DSA + ElGamal encryption. When I move this exact
> route to Karaf, the RSA encryption continues to work but the DSA + ElGamal
> gives the following stack trace:
> >
> > org.bouncycastle.openpgp.PGPException: exception encrypting session key
> at org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown Source)
> at org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown Source)
> at
> org.apache.camel.converter.crypto.PGPDataFormat.marshal(PGPDataFormat.java:86)
> at
> org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.java:59)
> at
> org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
> at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
> at
> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
> at
> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:334)
> at
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220)
> at
> org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
> at
> org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:303)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
> at org.apache.camel.processor.Pipeline.process(Pipeline.java:117) at
> org.apache.camel.processor.Pipeline.process(Pipeline.java:80) at
> org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
> at
> org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)
> at
> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)
> at
> org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
> at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86)
> at
> org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:104)
> at
> org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:560)
> at
> org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:498)
> at
> org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:467)
> at
> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325)
> at
> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263)
> at
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1058)
> at
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1050)
> at
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:947)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:662) Caused by:
> org.bouncycastle.openpgp.PGPException: exception constructing public key at
> org.bouncycastle.openpgp.PGPPublicKey.getKey(Unknown Source) at
> org.bouncycastle.openpgp.PGPEncryptedDataGenerator$PubMethod.addSessionInfo(Unknown
> Source) ... 46 more Caused by: java.security.spec.InvalidKeySpecException:
> key spec not recognised at
> org.bouncycastle.jcajce.provider.asymmetric.util.BaseKeyFactorySpi.engineGeneratePublic(Unknown
> Source) at
> org.bouncycastle.jcajce.provider.asymmetric.elgamal.KeyFactorySpi.engineGeneratePublic(Unknown
> Source) at java.security.KeyFactory.generatePublic(KeyFactory.java:298) ...
> 48 more
> >
> > I'm using the jre.properties.cxf (moved to jre.properties) and have this
> in my config.properties:
> > # configure karaf security providers
> > org.apache.karaf.security.providers =
> org.bouncycastle.jce.provider.BouncyCastleProvider
> >
> > # javax.transaction is needed to avoid class loader constraint violation
> when using javax.sql
> >
> org.osgi.framework.bootdelegation=org.apache.karaf.jaas.boot,sun.*,com.sun.*,javax.transaction,javax.transaction.*,org.bouncycastle*
> >
> > I've also loaded bcprov-jdk16-1.46.jar into lib/ext since I'm using Java
> SDK 1.6.
> >
> > Any suggestions/ideas on what could be wrong?
> >
> > Gaurav
>
>
>

Re: Camel-Crypto ElGamal encryption works in mvn camel:run but not in Karaf/OSGi

Posted by Willem jiang <wi...@gmail.com>.
I just checked the dependency of camel-crypto, it just use bcprov-jdk15on jar,

<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpg-jdk15on</artifactId>
<version>${bouncycastle-version}</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>${bouncycastle-version}</version>
</dependency>



The version is 1.47.   
I also checked the website[1], it doesn't has the release of bcprov-jdk16-xxx.jar.

Can you try to put that on in your lib/ext directly.  

[1]http://www.bouncycastle.org/latest_releases.html
--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem


Sent with Sparrow (http://www.sparrowmailapp.com/?sig)


On Friday, January 25, 2013 at 2:04 AM, Patel, Gaurav wrote:

> I have camel 2.10.3 installed and am using the example pubring-ElGamal.gpg from 'components\camel-crypto\src\test\resources\org\apache\camel\component\crypto' in camel-crypto and user 'sdude@nowhere.net (mailto:sdude@nowhere.net)'.
>  
> When I run the camel route with mvn camel:run, the RSA encryption works perfectly as well as the DSA + ElGamal encryption. When I move this exact route to Karaf, the RSA encryption continues to work but the DSA + ElGamal gives the following stack trace:
>  
> org.bouncycastle.openpgp.PGPException: exception encrypting session key at org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown Source) at org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown Source) at org.apache.camel.converter.crypto.PGPDataFormat.marshal(PGPDataFormat.java:86) at org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.java:59) at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:334) at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220) at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:303) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.Pipeline.process(Pipeline.java:117) at org.apache.camel.processor.Pipeline.process(Pipeline.java:80) at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150) at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117) at org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86) at org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:104) at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:560) at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:498) at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:467) at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325) at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1058) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1050) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:947) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: org.bouncycastle.openpgp.PGPException: exception constructing public key at org.bouncycastle.openpgp.PGPPublicKey.getKey(Unknown Source) at org.bouncycastle.openpgp.PGPEncryptedDataGenerator$PubMethod.addSessionInfo(Unknown Source) ... 46 more Caused by: java.security.spec.InvalidKeySpecException: key spec not recognised at org.bouncycastle.jcajce.provider.asymmetric.util.BaseKeyFactorySpi.engineGeneratePublic(Unknown Source) at org.bouncycastle.jcajce.provider.asymmetric.elgamal.KeyFactorySpi.engineGeneratePublic(Unknown Source) at java.security.KeyFactory.generatePublic(KeyFactory.java:298) ... 48 more
>  
> I'm using the jre.properties.cxf (moved to jre.properties) and have this in my config.properties:
> # configure karaf security providers
> org.apache.karaf.security.providers = org.bouncycastle.jce.provider.BouncyCastleProvider
>  
> # javax.transaction is needed to avoid class loader constraint violation when using javax.sql
> org.osgi.framework.bootdelegation=org.apache.karaf.jaas.boot,sun.*,com.sun.*,javax.transaction,javax.transaction.*,org.bouncycastle*
>  
> I've also loaded bcprov-jdk16-1.46.jar into lib/ext since I'm using Java SDK 1.6.
>  
> Any suggestions/ideas on what could be wrong?
>  
> Gaurav