在项目开发期间,需要加密从XML文件读取的数据,然后写入另一个文件并解密。问题是,当读取加密文件时,会出现未读取的XML服务符号并给出错误。问题是如何从文件中读取数据?
Encryption Algorithms
我读取文件的代码列表
try {
File file = new File(filePath);
DocumentBuilderFactory documentBuilderFactory =
DocumentBuilderFactory
.newInstance();
DocumentBuilder documentBuilder =
documentBuilderFactory.newDocumentBuilder();
Document document = documentBuilder.parse(file);
password =
document.getElementsByTagName("KeyWord").item(0).getTextContent();
encDataAES =
document.getElementsByTagName("AES").item(0).getTextContent();
encDataRSA =
document.getElementsByTagName("RSA").item(0).getTextContent();
} catch (Exception e) {
System.out.println("Error reading configuration file:");
System.out.println(e.getMessage());
}