List Info

Thread: Decrypting Files with Bouncy Castle




Decrypting Files with Bouncy Castle
country flaguser name
United States
2007-10-24 15:35:31
Hello,

Does anyone have any experience with running a decryption
service in 
ServiceMix using Bouncy Castle?  We were able to setup a
service that 
would decrypt a file and run it through unit testing in
Eclipse, 
however, when we run it in ServiceMix we get the following:

org.bouncycastle.openpgp.PGPException: Exception
constructing key
java.security.spec.InvalidKeySpecException: Unknown KeySpec
type: 
org.bouncycastle.jce.spec.ElGamalPrivateKeySpec
        at 
org.bouncycastle.jce.provider.JDKKeyFactory$ElGamal.engineGe
neratePrivate(Unknown 
Source)
        at
java.security.KeyFactory.generatePrivate(KeyFactory.java:316
)
        at 
org.bouncycastle.openpgp.PGPSecretKey.extractPrivateKey(Unkn
own Source)
        at 
com.myco.services.PGPEncryptionHelper.findSecretKey(PGPEncry
ptionHelper.java:110)
        at 
com.myco.services.PGPEncryptionHelper.decryptFile(PGPEncrypt
ionHelper.java:151)
        at 
com.myco.services.FileDecryptor.decryptFile(FileDecryptor.ja
va:103)
        at 
com.myco.services.FileDecryptor.onMessageExchange(FileDecryp
tor.java:66)
        at 
org.apache.servicemix.bean.BeanEndpoint.onProviderExchange(B
eanEndpoint.java:224)
        at 
org.apache.servicemix.bean.BeanEndpoint.process(BeanEndpoint
.java:200)
        at 
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(As
yncBaseLifeCycle.java:538)
        at 
org.apache.servicemix.common.AsyncBaseLifeCycle.processExcha
nge(AsyncBaseLifeCycle.java:490)
        at 
org.apache.servicemix.common.BaseLifeCycle.onMessageExchange
(BaseLifeCycle.java:46)
        at 
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.proc
essInBound(DeliveryChannelImpl.java:610)
        at 
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(Ab
stractFlow.java:170)
        at 
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(S
edaFlow.java:167)
        at 
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(Seda
Queue.java:134)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Threa
dPoolExecutor.java:650)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo
lExecutor.java:675)
        at java.lang.Thread.run(Thread.java:595)

I checked the JAVA_HOME environment variable that ServiceMix
is using on 
startup and it is the correct one (configured with Bouncy
Castle v137).

Thoughts, suggestions, any help is appreciated.

Thanks,
Gordon Dickens

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )