Author: bback
Date: 2006-02-12 17:28:54 +0000 (Sun, 12 Feb 2006)
New Revision: 8027
Removed:
trunk/apps/frost-0.7/source/frost/crypt/Crypt.java
Modified:
trunk/apps/frost-0.7/source/frost/Core.java
trunk/apps/frost-0.7/source/frost/crypt/FrostCrypt.java
Log:
it becomes cleaner and cleaner
Modified: trunk/apps/frost-0.7/source/frost/Core.java
===================================================================
--- trunk/apps/frost-0.7/source/frost/Core.java 2006-02-12 17:24:47 UTC (rev
8026)
+++ trunk/apps/frost-0.7/source/frost/Core.java 2006-02-12 17:28:54 UTC (rev
8027)
@@ -56,8 +56,6 @@
private static Logger logger = Logger.getLogger(Core.class.getName());
-// static Hashtable myBatches = new Hashtable();
-
private static Core instance = new Core();
private static Locale locale = null;
@@ -67,7 +65,7 @@
public static SettingsClass frostSettings;
- private static Crypt crypto = new FrostCrypt();
+ private static FrostCrypt crypto = new FrostCrypt();
private class EventDispatcher {
@@ -327,61 +325,10 @@
return writeOK;
}
-// private void loadBatches()
-// {
-// //load the batches
-// File batches = new File("batches");
-// if (batches.exists() && batches.length() > 0) //fix previous version
bug
-// try {
-// String allBatches = FileAccess.readFile(batches);
-// String[] _batches = allBatches.split("_");
-// //dumb. will fix later
-//
-// for (int i = 0; i < _batches.length; i++)
-// {
-// myBatches.put(_batches[i], _batches[i]);
-// }
-//
-// logger.info("loaded " + _batches.length + " batches of
shared files");
-// } catch (Throwable e) {
-// logger.log(Level.SEVERE, "couldn't load
batches:", e);
-// }
-// }
-//
-// private boolean saveBatches() {
-// try {
-// StringBuffer buf = new StringBuffer();
-// synchronized (getMyBatches()) {
-// Iterator i = getMyBatches().keySet().iterator();
-// while (i.hasNext()) {
-// String current = (String) i.next();
-// if (current.length() > 0) {
-// buf.append(current);
-// if (i.hasNext()) {
-// buf.append("_");
-// }
-// } else {
-// i.remove(); //make sure no
empty batches are saved
-// }
-// }
-// }
-// File batches = new File("batches");
-// FileAccess.writeFile(buf.toString(), batches);
-// return true;
-// } catch (Throwable t) {
-// logger.log(Level.SEVERE, "Exception thrown in
saveBatches():", t);
-// }
-// return false;
-// }
-
- public static Crypt getCrypto() {
+ public static FrostCrypt getCrypto() {
return crypto;
}
-// public static Hashtable getMyBatches() {
-// return myBatches;
-// }
-
/**
* Tries to send old messages that have not been sent yet
*/
@@ -651,7 +598,6 @@
mainFrame.initialize();
//load vital data
-// loadBatches();
loadKnownBoards();
if (isFreenetOnline()) {
@@ -801,7 +747,6 @@
*/
public void save() throws StorageException {
boolean saveOK;
-// saveOK = saveBatches();
saveOK = saveKnownBoards();
if (!saveOK) {
throw new StorageException("Error while saving the core
items.");
Deleted: trunk/apps/frost-0.7/source/frost/crypt/Crypt.java
===================================================================
--- trunk/apps/frost-0.7/source/frost/crypt/Crypt.java 2006-02-12 17:24:47 UTC
(rev 8026)
+++ trunk/apps/frost-0.7/source/frost/crypt/Crypt.java 2006-02-12 17:28:54 UTC
(rev 8027)
@@ -1,67 +0,0 @@
-/*
- Crypt.java / Frost
- Copyright (C) 2003 Jan-Thomas Czornack <jantho at users.sourceforge.net>
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2 of
- the License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
-
-package frost.crypt;
-import java.io.File;
-
-/**
- * facade for verifying/signing messages in frost
- */
- public interface Crypt {
-
- /**
- * [0] private, [1] public
- */
- public String[] generateKeys();
-
- /**
- * generates a detached signature on a String.
- * @param message the string to be signed
- * @param key the private key
- * @return a detached signature not ascii armored
- */
- public String detachedSign(String message,String key);
-
- public String detachedSign(byte [] message,String key);
-
- /**
- * Verifies a String with a detached signature
- * @param message the message to be verified
- * @param key the key used for verification
- * @param sig the binary signature
- * @return whether the verification was successful
- */
- public boolean detachedVerify(String message, String key, String sig);
- public boolean detachedVerify(byte [] plaintext, String key, String sig);
-
- /**
- * checksum of a string
- */
- public String digest(String what);
- public String digest(File which);
-
- public byte[] encrypt(byte[] what, String publicKey);
- public byte[] decrypt(byte [] what, String privateKey);
- public String encrypt(String what, String publicKey);
- public String decrypt(String what, String privateKey);
-
- public String encode64(String what);
-
- public String decode64(String what);
- }
Modified: trunk/apps/frost-0.7/source/frost/crypt/FrostCrypt.java
===================================================================
--- trunk/apps/frost-0.7/source/frost/crypt/FrostCrypt.java 2006-02-12
17:24:47 UTC (rev 8026)
+++ trunk/apps/frost-0.7/source/frost/crypt/FrostCrypt.java 2006-02-12
17:28:54 UTC (rev 8027)
@@ -42,7 +42,7 @@
/**
* Implementation of the crypto layer.
*/
-public final class FrostCrypt implements Crypt {
+public final class FrostCrypt {
private static Logger logger =
Logger.getLogger(FrostCrypt.class.getName());