GnuPG + Java

Jaya Christina jayachristina@hotmail.com
Mon Apr 29 14:09:01 2002


Hi *,

The following code is giving an error
        usage: gpg [options] [filename]

        when the -r is jaya christina in double quotes.

When I give same in single quotes also I get the same error.Same error for
without quotes.Any idea anybody??

If the -r is a single name in double or single quotes like 'jaya' the error
is : A recepient with name "jaya" is available.
        gpg: 'Kalibra'--armor: skipped: public key not found
        gpg: input.txt: encryption failed: public key not found

import java.io.*;
public class GnuPGTest{
 public static void main(String[] arg){
      Process p;
          try{
               String exec = "gpg -r Kalibra On
Web --armor --yes --batch --output output.gpg --encrypt input.txt"  ;
               p = Runtime.getRuntime().exec(exec);
               p.waitFor();
               InputStream is = p.getErrorStream();
               String stream = "";
               while(is.available()!=0){
                    stream += (char)is.read();
               }
               System.out.println(stream );
              }catch(Exception io){
                   System.out.println("Error creating process. IOException
encrypt" + io);
              }
     }}

Ciao,
Jaya Christina