如何在WSO2 ESB中解密文件?

时间:2018-06-19 12:53:46

标签: wso2 esb

在WSO2中解密文件的最佳方法是什么?

我当时正在考虑使用GPG来做到这一点,还有其他想法吗?

1 个答案:

答案 0 :(得分:0)

您首先需要下载一个加密软件,以便能够加密本地系统中的某些文件。 例如(gpg4win)。

然后您需要创建一个密钥对,稍后将使用它来加密。

<property value="example@example.com" name="emailKey"/> <property value="C:/trainning/folder1/" name="inputFilePath"/><property value="C:/trainning/folder2/" name="outputFilePath"/> <property value="example.txt" name="inputFileName"/> <property value="encryptedExampleTXT.gpg" name="outputFileName"/> <property expression="fn:concat($ctx:inputFilePath,$ctx:inputFileName)" name="inputPathAndFileName"/> <property expression="fn:concat($ctx:outputFilePath,$ctx:outputFileName)" name="outputPathAndFileName"/> <script language="js"> <![CDATA[var command = "gpg -v --no-secmem-warning -r " + String(mc.getProperty('emailKey')) + " --always-trust --armor --output " + String(mc.getProperty('outputPathAndFileName')) + " --encrypt " + String(mc.getProperty('inputPathAndFileName')); print(command.toString()); var process = java.lang.Runtime.getRuntime().exec(command);process.waitFor();]]> </script>

如果您想了解更多详细信息,我已在Medium上发布了逐步解决方案。 https://medium.com/@antoniocarlosreis/how-to-encrypt-files-using-gpg-in-wso2-esb-1b612dc7abde

相关问题