How to encrypt txt with pgp?

Viewed 29

I have a simple txt and I want to encrypt it with pgp, I am currently using spring boot I show you the txt

 List<String> info= new ArrayList<>();
       info.add("hello world");



    public List<String>  txt(List<String>  data) throws IOException {
        File nameFile = new File("test.txt");
        FileWriter save = new FileWriter("C:\\Downloads\\" +nameFile);
        PrintWriter writer = new PrintWriter(save);
        for (String i: data){
            writer.println(i);
        }
        writer.close();
        return data;
    }

how to encrypt with spring boot using pgp

0 Answers
Related