| 1 6 21 22 import de.schlichtherle.io.*; 23 import de.schlichtherle.io.File; 24 25 import java.io.*; 26 27 44 public class encrypt { 45 private static final nzip.ProgressMonitor progressMonitor 46 = new nzip.ProgressMonitor(); 47 48 public static void main(final String [] args) throws IOException { 49 if (args.length != 2) 50 usage(); 51 52 nzip.configKeyManager(); 53 54 if (new File(args[1]).isEntry()) 55 progressMonitor.start(); 56 57 try { 58 RaesFileUtils.encrypt(args[0], args[1]); 59 } finally { 60 try { 62 File.umount(); 63 } finally { 64 progressMonitor.interrupt(); 65 } 66 } 67 } 68 69 private static void usage() { 70 System.err.println( 71 "encrypt (@version@)\n" + 72 "Copyright 2005-2006 Schlichtherle IT Services\n\n" + 73 "Wraps a file into an RAES encrypted file.\n\n" + 74 "Usage: encrypt SRC DST\n\n" + 75 "where SRC is the content file to wrap and DST is the resulting encrypted file.\n" + 76 "Please note that both files may actually be located in a ZIP file (.zip suffix)\n" + 77 "or an RAES encrypted ZIP file (.tzp suffix)."); 78 System.exit(1); 79 } 80 } 81 | Popular Tags |