How to use Bouncy Castle Provider with jasypt in Fuse?
Issue
We are running this on Jdk1.7.0_45, and have the bouncy castle jars in jre_folder/lib/ext and listed in jre_folder/lib/security/java.security.
We encrypt the property using the following command line:
C:\Users\M16896\Desktop\Programs\jasypt-1.9.2\bin>encrypt.bat input=thisisapassword password=cloudscape algorithm=PBEWITHSHA256AND128BITAES-CBC-BC providerClassName=org.bouncycastle.jce.provider.BouncyCastleProvider
And copy the result in our .cfg file, like this:
exception.db.datasource.password = ENC(+7/Y5VngB2v5n5+DB1w2EF6fOL5tgH+0ioAoZR8RL80agWDd200Nd6tjJBQlIsFu)
But we got exceptions like below:
05 May 2014 16:30:59,089 | ERROR | lixDispatchQueue | BlueprintCamelContext | 152 - org.apache.camel.camel-blueprint - 2.12.0.redhat-610379 | Error occurred during starting Camel: CamelContext(exceptionPoller) due Failed to create route ExceptionQueueToDatabase: Route(ExceptionQueueToDatabase)[[From[activemq:queue:{{excep... because of Failed to resolve endpoint: activemq:queue:{{exception.queue.name}} due to: org.jasypt.exceptions.EncryptionOperationNotPossibleException
org.apache.camel.FailedToCreateRouteException: Failed to create route ExceptionQueueToDatabase: Route(ExceptionQueueToDatabase)[[From[activemq:queue:{{excep... because of Failed to resolve endpoint: activemq:queue:{{exception.queue.name}} due to: org.jasypt.exceptions.EncryptionOperationNotPossibleException
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:182)
at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:778)[144:org.apache.camel.camel-core:2.12.0.redhat-610379]
at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1955)[144:org.apache.camel.camel-core:2.12.0.redhat-610379]
at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1705)[144:org.apache.camel.camel-core:2.12.0.redhat-610379]
at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1579)[144:org.apache.camel.camel-core:2.12.0.redhat-610379]
- How to encrypt/decrypt a password for ActiveMQ using BouncyCastle?
Environment
- Red Hat JBoss Fuse 6.x
- Red Hat JBoss A-MQ 6.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
