Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-5869

Exception when Encrypting with PGPDataFormat

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: jboss-fuse-6.2.1
    • Fix Version/s: jboss-fuse-6.3
    • Component/s: Camel
    • Labels:
      None
    • Environment:

      ALL

    • Sprint:
      Sprint 6 - towards CR1
    • Steps to Reproduce:
      Hide
      • Unzip the attached reproducer_01670026.zip
      • Unzip gnupg.zip. It contains key rings.
      • In blueprint.xml set the consumer(from ...) and producer(to...) path to your local system path. In path set as consumer, place a text file with some text data.
      • In blueprint.xml set the keyFileName of `pgp tag` to point pubring.gpg within extracted gnupg.zip.
      • In pom.xml set properties tag as
         <properties>
            <camel.version>2.15.1.redhat-621084</camel.version>
          </properties>
        
      • Build project using command `mvn clean install`.
      • Once build in Fuse, run following commands
        features:install camel-crypto 
        osgi:install -s mvn:com.mycompany/camel-pgpdataformat-example/1.0.0-SNAPSHOT
        
      • Exception observed is
        org.bouncycastle.openpgp.PGPException: exception constructing public key
                at org.bouncycastle.openpgp.operator.jcajce.JcaPGPKeyConverter.getPublicKey(Unknown Source)[265:bcpg:1.52.0]
                at org.bouncycastle.openpgp.operator.jcajce.JcePublicKeyKeyEncryptionMethodGenerator.encryptSessionInfo(Unkn
        own Source)[265:bcpg:1.52.0]
                at org.bouncycastle.openpgp.operator.PublicKeyKeyEncryptionMethodGenerator.generate(Unknown Source)[265:bcpg
        :1.52.0]
                at org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown Source)[265:bcpg:1.52.0]
                at org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown Source)[265:bcpg:1.52.0]
                at org.apache.camel.converter.crypto.PGPKeyAccessDataFormat.marshal(PGPKeyAccessDataFormat.java:234)[266:org
        .apache.camel.camel-crypto:2.15.1.redhat-621084]
                at org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.java:83)[198:org.apache.camel.camel-
        core:2.15.1.redhat-621084]
                at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)[198:org.ap
        ache.camel.camel-core:2.15.1.redhat-621084]
                at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:448)[198:org.apache
        .camel.camel-core:2.15.1.redhat-621084]
                at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[198:org.apache
        .camel.camel-core:2.15.1.redhat-621084]
                at org.apache.camel.processor.Pipeline.process(Pipeline.java:121)[198:org.apache.camel.camel-core:2.15.1.red
        hat-621084]
                at org.apache.camel.processor.Pipeline.process(Pipeline.java:83)[198:org.apache.camel.camel-core:2.15.1.redh
        at-621084]
                at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[198:org.apache
        .camel.camel-core:2.15.1.redhat-621084]
                at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:435)[198:org
        .apache.camel.camel-core:2.15.1.redhat-621084]
                at org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:211)[198:org.ap
        ache.camel.camel-core:2.15.1.redhat-621084]
                at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:175)[198:org.apache.cam
        el.camel-core:2.15.1.redhat-621084]
                at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:174)[198:org.apache.camel.ca
        mel-core:2.15.1.redhat-621084]
                at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:101)[198:org.apache.camel.came
        l-core:2.15.1.redhat-621084]
                at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_99]
                at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)[:1.7.0_99]
                at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecut
        or.java:178)[:1.7.0_99]
                at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[:1.7.0_99]
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_99]
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_99]
                at java.lang.Thread.run(Thread.java:745)[:1.7.0_99]
        Caused by: java.security.spec.InvalidKeySpecException: key spec not recognised
                at org.bouncycastle.jcajce.provider.asymmetric.util.BaseKeyFactorySpi.engineGeneratePublic(Unknown Source)[bcprov-jdk15on.jar:1.52.0]
                at org.bouncycastle.jcajce.provider.asymmetric.elgamal.KeyFactorySpi.engineGeneratePublic(Unknown Source)[bcprov-jdk15on.jar:1.52.0]
                at java.security.KeyFactory.generatePublic(KeyFactory.java:334)[:1.7.0_99]
                ... 25 more
        
        
      Show
      Unzip the attached reproducer_01670026.zip Unzip gnupg.zip. It contains key rings. In blueprint.xml set the consumer(from ...) and producer(to...) path to your local system path. In path set as consumer, place a text file with some text data. In blueprint.xml set the keyFileName of `pgp tag` to point pubring.gpg within extracted gnupg.zip. In pom.xml set properties tag as <properties> <camel.version>2.15.1.redhat-621084</camel.version> </properties> Build project using command `mvn clean install`. Once build in Fuse, run following commands features:install camel-crypto osgi:install -s mvn:com.mycompany/camel-pgpdataformat-example/1.0.0-SNAPSHOT Exception observed is org.bouncycastle.openpgp.PGPException: exception constructing public key at org.bouncycastle.openpgp. operator .jcajce.JcaPGPKeyConverter.getPublicKey(Unknown Source)[265:bcpg:1.52.0] at org.bouncycastle.openpgp. operator .jcajce.JcePublicKeyKeyEncryptionMethodGenerator.encryptSessionInfo(Unkn own Source)[265:bcpg:1.52.0] at org.bouncycastle.openpgp. operator .PublicKeyKeyEncryptionMethodGenerator.generate(Unknown Source)[265:bcpg :1.52.0] at org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown Source)[265:bcpg:1.52.0] at org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown Source)[265:bcpg:1.52.0] at org.apache.camel.converter.crypto.PGPKeyAccessDataFormat.marshal(PGPKeyAccessDataFormat.java:234)[266:org .apache.camel.camel-crypto:2.15.1.redhat-621084] at org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.java:83)[198:org.apache.camel.camel- core:2.15.1.redhat-621084] at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)[198:org.ap ache.camel.camel-core:2.15.1.redhat-621084] at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:448)[198:org.apache .camel.camel-core:2.15.1.redhat-621084] at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[198:org.apache .camel.camel-core:2.15.1.redhat-621084] at org.apache.camel.processor.Pipeline.process(Pipeline.java:121)[198:org.apache.camel.camel-core:2.15.1.red hat-621084] at org.apache.camel.processor.Pipeline.process(Pipeline.java:83)[198:org.apache.camel.camel-core:2.15.1.redh at-621084] at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[198:org.apache .camel.camel-core:2.15.1.redhat-621084] at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:435)[198:org .apache.camel.camel-core:2.15.1.redhat-621084] at org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:211)[198:org.ap ache.camel.camel-core:2.15.1.redhat-621084] at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:175)[198:org.apache.cam el.camel-core:2.15.1.redhat-621084] at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:174)[198:org.apache.camel.ca mel-core:2.15.1.redhat-621084] at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:101)[198:org.apache.camel.came l-core:2.15.1.redhat-621084] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_99] at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)[:1.7.0_99] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecut or.java:178)[:1.7.0_99] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[:1.7.0_99] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_99] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_99] at java.lang. Thread .run( Thread .java:745)[:1.7.0_99] Caused by: java.security.spec.InvalidKeySpecException: key spec not recognised at org.bouncycastle.jcajce.provider.asymmetric.util.BaseKeyFactorySpi.engineGeneratePublic(Unknown Source)[bcprov-jdk15on.jar:1.52.0] at org.bouncycastle.jcajce.provider.asymmetric.elgamal.KeyFactorySpi.engineGeneratePublic(Unknown Source)[bcprov-jdk15on.jar:1.52.0] at java.security.KeyFactory.generatePublic(KeyFactory.java:334)[:1.7.0_99] ... 25 more

      Description

      • Issue appears only with Red Hat JBoss Fuse 6.2.1, not with Fuse 6.1.0.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                oscerd Andrea Cosentino
                Reporter:
                cpandey Chandra Shekhar Pandey
                Tester:
                Fernando FR
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: