开发者

PGP Decrypt using ANT

开发者 https://www.devze.com 2023-02-14 18:06 出处:网络
We have an ant build file th开发者_开发百科at needs to encrypt/decrypt a bunch of files using a PGP Public Key.

We have an ant build file th开发者_开发百科at 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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号