GPGUtils is a simple wrapper for ProcessBuilder to make shell out to gpg easier in Java.
It provides a simple interface for encrypting/decrypting String, File and InputStream.
There's also generic method to run other gpg command.
Existing solutions for using gpg in Java have mostly involved BouncyCastle. It works, but, its API isn't the nicest to use, to say the least.
Using ProcessBuilder is much simpler compared with BouncyCastle. But it's not easy to get IO buffering right for external processes.
GPGUtils tries to provide a simple interface while hiding away the complexity of IO buffer handling.
Refer to the Unit Tests for now.
mvn verifyNeed to set environment variables first:
GPG_KEYNAMEOSSRH_USERNAMEOSSRH_PASSWORD
mvn -s settings.xml -P ossrh clean deploy