Hello
I'm having a problem encrypting a String text using the GnuPG class. I'm using
the encrypt and decrypt class fromĀ
http://www.macnews.co.il/mageworks/java/gnupg/sample-code.shtml which is based
on the GnuPG class fromĀ
http://lists.gnupg.org/pipermail/gnupg-devel/2002-February/018098.html. However
I keep getting a null pointer exception. I don't know what I'm doing wrong. I'd
appreciate your help with this
this is my code:
GnuPG pgp = new GnuPG (); result = pgp.encrypt (text, keyID);and this is what
throws the null pointer exception in the GnuPG class:public void encrypt(String
str, String rcpt) { System.out.print("Encrypting... "); try {
p= Runtime.getRuntime().exec(("gpg --armor --batch --encrypt -r "+
rcpt).split("\\s+")); } catch (IOException io) { System.out.println("Error
creating process."); } ProcessStreamReader psr_stdout = new
ProcessStreamReader("STDIN", p.getInputStream()); ProcessStreamReader
psr_stderr = new ProcessStreamReader("STDERR", p.getErrorStream());
....
}_______________________________________________
Gnupg-users mailing list
[email protected]
http://lists.gnupg.org/mailman/listinfo/gnupg-users