Hi,

II am trying to decrypt a pgp file using the Camel PGP format. The route
reads a PGP encrypted file from a folder and send it for decryption as shown
below.


*from('file:/home/user/Outbound?charset=utf-8&move=.processed&moveFailed=.failedProcessing&include=.*.xml.gpg&delete=false').to('direct:pgpDecryptStep');

PGPDataFormat pgpFmt = new PGPDataFormat();
pgpFmt.setKeyFileName('file:/home/user/PRIVATE_KEY.pgp');
pgpFmt.setKeyUserid('USER_ID');
pgpFmt.setArmored(false);
pgpFmt.setPassword('PASSWORD');

from('direct:pgpDecryptSte').unmarshal(pgpFmt).to('direct:decryptedData');*

I am getting the following exception 
java.io.IOException: unknown object in stream: 0
        at org.bouncycastle.openpgp.PGPObjectFactory.nextObject(Unknown Source)
~[bcpg-jdk15on-1.50.jar:1.50.0]

I can also see in the trace the following:
BodyType            org.apache.camel.component.file.GenericFile

Can the PGP format unmarshal a body of the type above?

I can decrypt the same file successfully using the command line tools. I
have also successfully used Camel PGP encryption and the encrypted file was
successfully decrypted by the receiving party.

I would appreciate any help with this issue?

Thanks a lot
Hs



--
View this message in context: 
http://camel.465427.n5.nabble.com/PGP-decryption-from-File-route-tp5746035.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to