CrushClient can do all the transfer scenarios for the various protocols and also includes the abilities of doing the PGP on the fly encryption and decryption.
Here are a few examples using it to do the PGP operations on a copy.
Encrypting using a public key on a local file copy:
java -jar CrushTunnel.jar inline_script "config pgpEncryptUpload true;config pgpPublicKeyUploadPath mykey.pub;connect file://;put KB2.txt KB3.txt;quit;"Decrypt:
java -jar CrushTunnel.jar inline_script "config pgpDecryptUpload true;config pgpPrivateKeyUploadPath mykey.key;config pgpPrivateKeyUploadPassword password;connect file://;put KB3.txt KB2.txt;quit;"Doing this in code is more complicated, but also possible if necessary. Classes come from CrushTunnel.jar located in your WebInterface folder.
//encrypt GenericClient c = Common.getClient("file://","",null); c.setConfig("pgpEncryptUpload","true"); c.setConfig("pgpPublicKeyPath","/path/to/mykey.pub"); OutputStream out = c.upload("/path/to/destfile.txt",0,true,true); //write bytes, close out. c.logout(); //decrypt GenericClient c = Common.getClient("file://","",null); c.setConfig("pgpDecryptUpload","true"); c.setConfig("pgpPrivateKeyUploadPath","/path/to/mykey.key"); c.setConfig("pgpPrivateKeyUploadPassword","password"); OutputStream out = c.upload("/path/to/destfile.txt",0,true,true); //write bytes from encrypted file, close out. c.logout();
Add new attachment
Only authorized users are allowed to upload new attachments.
«
This particular version was published on 05-Dec-2023 05:32 by Ben Spink.
G’day (anonymous guest)
Log in
JSPWiki