Update of /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/passphraseagents
In directory sc8-pr-cvs1:/tmp/cvs-serv5157/src/java/org/neuclear/commons/crypto/passphraseagents
Modified Files:
AlwaysTheSamePassphraseAgent.java AskAtStartupAgent.java
InteractiveAgent.java PassPhraseAgent.java
StoredPassphraseAgent.java
Log Message:
Revamped a lot of exception handling throughout the framework, it has been simplified in most places:
- For most cases the main exception to worry about now is InvalidNamedObjectException.
- Most lowerlevel exception that cant be handled meaningful are now wrapped in the LowLevelException, a
runtime exception.
- Source and Store patterns each now have their own exceptions that generalizes the various physical
exceptions that can happen in that area.
Index: AlwaysTheSamePassphraseAgent.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/passphraseagents/AlwaysTheSamePassphraseAgent.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** AlwaysTheSamePassphraseAgent.java 21 Nov 2003 04:43:40 -0000 1.2
--- AlwaysTheSamePassphraseAgent.java 19 Dec 2003 18:02:53 -0000 1.3
***************
*** 1,4 ****
--- 1,6 ----
package org.neuclear.commons.crypto.passphraseagents;
+ import org.neuclear.commons.LowLevelException;
+
/*
NeuClear Distributed Transaction Clearing Platform
***************
*** 21,24 ****
--- 23,34 ----
$Id$
$Log$
+ Revision 1.3 2003/12/19 18:02:53 pelle
+ Revamped a lot of exception handling throughout the framework, it has been simplified in most places:
+ - For most cases the main exception to worry about now is InvalidNamedObjectException.
+ - Most lowerlevel exception that cant be handled meaningful are now wrapped in the LowLevelException, a
+ runtime exception.
+ - Source and Store patterns each now have their own exceptions that generalizes the various physical
+ exceptions that can happen in that area.
+
Revision 1.2 2003/11/21 04:43:40 pelle
EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
***************
*** 59,62 ****
--- 69,77 ----
public final char[] getPassPhrase(final String name) {
return passphrase.toCharArray();
+ }
+
+ public char[] getPassPhrase(String name, boolean incorrect) throws UserCancellationException {
+ if (incorrect) throw new LowLevelException("passphrase is incorrect for: "+name);
+ return getPassPhrase(name);
}
Index: AskAtStartupAgent.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/passphraseagents/AskAtStartupAgent.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** AskAtStartupAgent.java 19 Dec 2003 00:31:15 -0000 1.4
--- AskAtStartupAgent.java 19 Dec 2003 18:02:53 -0000 1.5
***************
*** 1,4 ****
--- 1,6 ----
package org.neuclear.commons.crypto.passphraseagents;
+ import org.neuclear.commons.LowLevelException;
+
/*
NeuClear Distributed Transaction Clearing Platform
***************
*** 21,24 ****
--- 23,34 ----
$Id$
$Log$
+ Revision 1.5 2003/12/19 18:02:53 pelle
+ Revamped a lot of exception handling throughout the framework, it has been simplified in most places:
+ - For most cases the main exception to worry about now is InvalidNamedObjectException.
+ - Most lowerlevel exception that cant be handled meaningful are now wrapped in the LowLevelException, a
+ runtime exception.
+ - Source and Store patterns each now have their own exceptions that generalizes the various physical
+ exceptions that can happen in that area.
+
Revision 1.4 2003/12/19 00:31:15 pelle
Lots of usability changes through out all the passphrase agents and end user tools.
***************
*** 54,57 ****
--- 64,68 ----
public AskAtStartupAgent(final InteractiveAgent agent, final String name) throws UserCancellationException {
this.name = name;
+ this.agent=agent;
this.passphrase = agent.getPassPhrase(name);
}
***************
*** 70,75 ****
}
private final String name;
! private final char[] passphrase;
}
--- 81,97 ----
}
+ public char[] getPassPhrase(String name, boolean incorrect) throws UserCancellationException {
+ if (incorrect) {
+ if (name.equals(this.name))
+ passphrase=agent.getPassPhrase(name);
+ else
+ throw new LowLevelException(getClass().getName()+"\nCan not provide passphrase for: "+name);
+ }
+ return getPassPhrase(name);
+ }
+
private final String name;
! private char[] passphrase;
! private final PassPhraseAgent agent;
}
Index: InteractiveAgent.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/passphraseagents/InteractiveAgent.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** InteractiveAgent.java 19 Dec 2003 00:31:15 -0000 1.2
--- InteractiveAgent.java 19 Dec 2003 18:02:53 -0000 1.3
***************
*** 21,24 ****
--- 21,32 ----
$Id$
$Log$
+ Revision 1.3 2003/12/19 18:02:53 pelle
+ Revamped a lot of exception handling throughout the framework, it has been simplified in most places:
+ - For most cases the main exception to worry about now is InvalidNamedObjectException.
+ - Most lowerlevel exception that cant be handled meaningful are now wrapped in the LowLevelException, a
+ runtime exception.
+ - Source and Store patterns each now have their own exceptions that generalizes the various physical
+ exceptions that can happen in that area.
+
Revision 1.2 2003/12/19 00:31:15 pelle
Lots of usability changes through out all the passphrase agents and end user tools.
***************
*** 42,46 ****
*/
public interface InteractiveAgent extends PassPhraseAgent {
- char[] getPassPhrase(String name,boolean incorrect) throws UserCancellationException;
}
--- 50,53 ----
Index: PassPhraseAgent.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/passphraseagents/PassPhraseAgent.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** PassPhraseAgent.java 19 Dec 2003 00:31:15 -0000 1.3
--- PassPhraseAgent.java 19 Dec 2003 18:02:53 -0000 1.4
***************
*** 22,25 ****
--- 22,33 ----
$Id$
$Log$
+ Revision 1.4 2003/12/19 18:02:53 pelle
+ Revamped a lot of exception handling throughout the framework, it has been simplified in most places:
+ - For most cases the main exception to worry about now is InvalidNamedObjectException.
+ - Most lowerlevel exception that cant be handled meaningful are now wrapped in the LowLevelException, a
+ runtime exception.
+ - Source and Store patterns each now have their own exceptions that generalizes the various physical
+ exceptions that can happen in that area.
+
Revision 1.3 2003/12/19 00:31:15 pelle
Lots of usability changes through out all the passphrase agents and end user tools.
***************
*** 67,69 ****
--- 75,79 ----
*/
char[] getPassPhrase(String name) throws UserCancellationException;
+
+ char[] getPassPhrase(String name,boolean incorrect) throws UserCancellationException;
}
Index: StoredPassphraseAgent.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/passphraseagents/StoredPassphraseAgent.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** StoredPassphraseAgent.java 21 Nov 2003 04:43:41 -0000 1.3
--- StoredPassphraseAgent.java 19 Dec 2003 18:02:53 -0000 1.4
***************
*** 1,4 ****
--- 1,6 ----
package org.neuclear.commons.crypto.passphraseagents;
+ import org.neuclear.commons.LowLevelException;
+
/*
NeuClear Distributed Transaction Clearing Platform
***************
*** 21,24 ****
--- 23,34 ----
$Id$
$Log$
+ Revision 1.4 2003/12/19 18:02:53 pelle
+ Revamped a lot of exception handling throughout the framework, it has been simplified in most places:
+ - For most cases the main exception to worry about now is InvalidNamedObjectException.
+ - Most lowerlevel exception that cant be handled meaningful are now wrapped in the LowLevelException, a
+ runtime exception.
+ - Source and Store patterns each now have their own exceptions that generalizes the various physical
+ exceptions that can happen in that area.
+
Revision 1.3 2003/11/21 04:43:41 pelle
EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
***************
*** 62,66 ****
return passphrase.toCharArray();
else
! return new char[0];
}
--- 72,86 ----
return passphrase.toCharArray();
else
! throw new LowLevelException(getClass().getName()+"\nCan not provide passphrase for: "+name);
! }
!
! public char[] getPassPhrase(String name, boolean incorrect) throws UserCancellationException {
! if (incorrect) {
! if (name.equals(this.name))
! throw new LowLevelException(getClass().getName()+"\nIncorrect passphrase set for:"+name);
! else
! throw new LowLevelException(getClass().getName()+"\nCan not provide passphrase for: "+name);
! }
! return getPassPhrase(name);
}
|