I have an issue with Camel PGP decrypting and I believe it is something with
imcompatibility but I can't find anything, however, it does not work. I
don't know if it is me or...
Camel 2.15
I can get it to work if I encrypt the files THEN zip them up, so when I get
the file I have a route to unzip, then one to decrypt. I am using GnuPG.
If I encrypt the zip file this doesn't work.
my customer is doing this and I can decypt it on the command line using
GnuPG but not with camel.
Hi Gary,
My code is written in C# and I’m just using the Microsoft
System.IO.Compression libraries to zip the files. I then take that zip file
and pass it through the Bouncy Castle libraries to encrypt it.
I’m not using any encryption in the compression step, or am I using any
compression in the encryption step (if that makes sense). They’re two
separate steps.
code snipits are simple and text book ----
@Override
public void configure() throws Exception {
PGPDataFormat pgpVerifyAndDecrypt = new PGPDataFormat();
pgpVerifyAndDecrypt.setKeyFileName("keys/secring.gpg");
pgpVerifyAndDecrypt.setKeyUserid(pgpKeyUserId);
pgpVerifyAndDecrypt.setPassword(pgpPassword);
pgpVerifyAndDecrypt.setArmored(Boolean.parseBoolean(pgpArmored));
pgpVerifyAndDecrypt.setSignatureKeyFileName("keys/pubring.gpg");
pgpVerifyAndDecrypt.setSignatureKeyUserid("CFIndustries");
pgpVerifyAndDecrypt.setSignatureVerificationOption(PGPKeyAccessDataFormat.SIGNATURE_VERIFICATION_OPTION_IGNORE);
//
pgpVerifyAndDecrypt.setSignatureVerificationOption(PGPKeyAccessDataFormat.SIGNATURE_VERIFICATION_OPTION_OPTIONAL);
//
pgpVerifyAndDecrypt.setSignatureVerificationOption(PGPKeyAccessDataFormat.SIGNATURE_VERIFICATION_OPTION_NO_SIGNATURE_ALLOWED);
// pgpVerifyAndDecrypt.setIntegrity(false);
from(fileEntranceEndpoint).id("cfi.decryption.endpointListenerRoute")
.log("Encrypted Message received ${file:name}")
.unmarshal(pgpVerifyAndDecrypt)
.convertBodyTo(String.class)
.log("CFI decrypted file name: ${file:name}")
.to("file://" + outDirectory);
}
/*
from(fileEntranceEndpoint).id("cfi.decryption.endpointListenerRoute")
.log("Message received ${file:name}")
.unmarshal(pgpVerifyAndDecrypt).split(new ZipSplitter())
.streaming().convertBodyTo(String.class)
.log("CFI file name: ${file:name}")
.to("file://" + outDirectory);
}
*/
public void setFileEntranceEndpoint(String fileEntranceEndpoint) {
this.fileEntranceEndpoint = fileEntranceEndpoint;
}
public void setPgpKeyUserId(String pgpKeyUserId) {
this.pgpKeyUserId = pgpKeyUserId;
}
public void setPgpPassword(String pgpPassword) {
this.pgpPassword = pgpPassword;
}
public void setPgpArmored(String pgpArmored) {
this.pgpArmored = pgpArmored;
}
public void setOutDirectory(String outDirectory) {
this.outDirectory = outDirectory;
}
public void setErrorArchive(String errorArchive) {
this.errorArchive = errorArchive;
}
public void setUnhandledArchive(String unhandledArchive) {
this.unhandledArchive = unhandledArchive;
}
}
PLEASE CAN SOMEONE TELL ME WHAT CAN AND CANNOT BE DONE HERE, And possibly a
hint to my problem. :) thanks again all !!!
--
View this message in context:
http://camel.465427.n5.nabble.com/decrypting-with-PGPDataFormat-tp5793436.html
Sent from the Camel - Users mailing list archive at Nabble.com.