根据文件名前缀,我想要PGP加密并使用不同的密钥签名。我可以使用多个加密路由并使用Message Router来引导它们。有没有人知道一种避免多路径的方法,并在路由运行时获取相关的PGP密钥?
final PGPDataFormat encryptAndSign01 = new PGPDataFormat();
encryptAndSign01.setKeyFileName(conf.pgpPublicKeyFile);
encryptAndSign01.setKeyUserid(conf.pgpEncryptUser01);
encryptAndSign01.setSignatureKeyFileName(conf.pgpPrivateKeyFile);
encryptAndSign01.setSignatureKeyUserid(conf.pgpSignUser01);
encryptAndSign01.setSignaturePassword(conf.pgpSignUser01Passphrase);
from("encrypt01")
.marshal(encryptAndSign01)
.to("file:tmp/output?fileName=${file:name}.pgp");
...
from("file:tmp/output?include=output.*.csv")
.choice()
.when(...)
.to(direct:encrypt01)
.when(...)
.to(direct:encrypt02);