1

We have an ant build file that needs to encrypt/decrypt a bunch of files using a PGP Public Key. Is there a native (or library) ant task to do so. I really would like to avoid solutions that involve the use of <exec> (unless ther is no other way around).

Much obliged

4

1 回答 1

2

This is how you do it with <exec>:

<exec executable="sh" >
    <arg value="-c" />
    <arg value="echo ${encrypted.passphrase} | gpg --passphrase-fd 0 --output ${data.dir}/Performance.dat --decrypt ${data.dir.encrypted}/${encrypted.file.name}"/>
</exec>

This way you provide the key passphrase in one line. But it would be nice to do it using something that is no OS dependent.

于 2011-03-07T18:29:16.177 回答