我拥有这段代码是为了为Neo4j创建一个简单的用户定义函数。
public class Join {
@UserFunction
@Description("example.DES ,, Decryption of any input values.")
public byte[] DES( @Name("set1") List<String> strings1) {
for (int i = 0; i < strings1.size(); i++) {
String dot;
dot = strings1.get(i);
try {
KeyGenerator kg = KeyGenerator.getInstance("DES");
SecretKey key = kg.generateKey();
SecretKeySpec keySpec = new SecretKeySpec(key.getEncoded(), "DES");
Cipher cipher = Cipher.getInstance("DES");
cipher.init(Cipher.ENCRYPT_MODE, keySpec);
byte[] cipherText = cipher.doFinal(dot.getBytes());
return cipherText;
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
但是在:public byte [] DES(
我收到此错误:
此方法必须返回类型为byte []的结果,所以请提出任何建议。