Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-12897

PGP Decryption in XML DSL not working

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.21.1
    • Fix Version/s: 2.21.4, 2.22.2, 2.23.0
    • Component/s: camel-crypto
    • Labels:
      None
    • Environment:

      This was tested on Windows 10, Java 1.8.191. Using camel core and camel crypto both at 2.21.1.

    • Estimated Complexity:
      Unknown

      Description

      I'm trying to use camel-crypto to crypt and decrypt files with PGP.

      Right now, I have the following in my XML DSL:

      <dataFormats>
          <pgp id="encrypt" keyFileName="party2public.pgp" keyUserid="party2"/>
          <pgp id="decrypt" keyFileName="party2private.pgp"/>
      </dataFormats>
      
      <route id="encrypter">
          <from uri="file:ToEncrypt"/>
          <marshal ref="encrypt"/>
          <to uri="file:Encrypted"/>
      </route>
      
      <route id="decrypter">
          <from uri="file:ToDecrypt"/>
          <unmarshal ref="decrypt"/>
          <to uri="file:Decrypted"/>
      </route>
      

       

      The encryption does work, while the decryption throws an error:

      org.bouncycastle.openpgp.PGPException: PGP message is encrypted with a key which could not be found in the Secret Keyring.

      I created a repo with the files being used (camel context, PGP private and public keys), that can be viewed here: https://github.com/apoguy/Camel-PGP-Test

        Attachments

        1. public.pgp
          1 kB
          Federico Einhorn
        2. private.pgp
          2 kB
          Federico Einhorn
        3. camel-context.xml
          2 kB
          Federico Einhorn

          Activity

            People

            • Assignee:
              acosentino Andrea Cosentino
              Reporter:
              feinhorn Federico Einhorn
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: