|
From: <pe...@us...> - 2003-11-21 04:43:45
|
Update of /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/applets
In directory sc8-pr-cvs1:/tmp/cvs-serv10533/src/java/org/neuclear/commons/crypto/applets
Modified Files:
KeyGenerationTask.java KeyGeneratorApplet.java
Log Message:
EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
Otherwise You will Finaliate.
Anything that can be final has been made final throughout everyting. We've used IDEA's Inspector tool to find all instance of variables that could be final.
This should hopefully make everything more stable (and secure).
Index: KeyGenerationTask.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/applets/KeyGenerationTask.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** KeyGenerationTask.java 19 Nov 2003 14:37:37 -0000 1.1
--- KeyGenerationTask.java 21 Nov 2003 04:43:40 -0000 1.2
***************
*** 11,14 ****
--- 11,20 ----
* $Id$
* $Log$
+ * Revision 1.2 2003/11/21 04:43:40 pelle
+ * EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
+ * Otherwise You will Finaliate.
+ * Anything that can be final has been made final throughout everyting. We've used IDEA's Inspector tool to find all instance of variables that could be final.
+ * This should hopefully make everything more stable (and secure).
+ *
* Revision 1.1 2003/11/19 14:37:37 pelle
* CommandLineAgent now masks the passphrase input using the JLine library which is now a dependency.
***************
*** 16,21 ****
*
*/
! public class KeyGenerationTask implements Runnable{
! public KeyGenerationTask(KeyPairGenerator kpg,KeyGeneratorApplet applet) {
this.kpg = kpg;
this.applet=applet;
--- 22,27 ----
*
*/
! public final class KeyGenerationTask implements Runnable{
! public KeyGenerationTask(final KeyPairGenerator kpg,final KeyGeneratorApplet applet) {
this.kpg = kpg;
this.applet=applet;
***************
*** 33,38 ****
* @see Thread#run()
*/
! public void run() {
! KeyPair kp=kpg.generateKeyPair();
applet.setKp(kp);
}
--- 39,44 ----
* @see Thread#run()
*/
! public final void run() {
! final KeyPair kp=kpg.generateKeyPair();
applet.setKp(kp);
}
Index: KeyGeneratorApplet.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/applets/KeyGeneratorApplet.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** KeyGeneratorApplet.java 19 Nov 2003 14:37:37 -0000 1.1
--- KeyGeneratorApplet.java 21 Nov 2003 04:43:40 -0000 1.2
***************
*** 20,23 ****
--- 20,29 ----
* $Id$
* $Log$
+ * Revision 1.2 2003/11/21 04:43:40 pelle
+ * EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
+ * Otherwise You will Finaliate.
+ * Anything that can be final has been made final throughout everyting. We've used IDEA's Inspector tool to find all instance of variables that could be final.
+ * This should hopefully make everything more stable (and secure).
+ *
* Revision 1.1 2003/11/19 14:37:37 pelle
* CommandLineAgent now masks the passphrase input using the JLine library which is now a dependency.
***************
*** 25,29 ****
*
*/
! public class KeyGeneratorApplet extends Applet {
/**
* Called by the browser or applet viewer to inform
--- 31,35 ----
*
*/
! public final class KeyGeneratorApplet extends Applet {
/**
* Called by the browser or applet viewer to inform
***************
*** 46,50 ****
* @see Applet#stop()
*/
! public void start() {
// TODO seed Random NumberGenerator
statusLabel.setText("Click OK to Start Key Generation");
--- 52,56 ----
* @see Applet#stop()
*/
! public final void start() {
// TODO seed Random NumberGenerator
statusLabel.setText("Click OK to Start Key Generation");
***************
*** 70,74 ****
* @see Applet#stop()
*/
! public void init() {
try {
random=SecureRandom.getInstance("SHA1PRNG");
--- 76,80 ----
* @see Applet#stop()
*/
! public final void init() {
try {
random=SecureRandom.getInstance("SHA1PRNG");
***************
*** 79,92 ****
}
agent=new GuiDialogAgent();
! Panel panel = new Panel();
panel.setLayout(new BorderLayout());
add(panel);
! Panel text = new Panel(new FlowLayout());
panel.add(text, BorderLayout.NORTH);
keygenTask=new Thread(new KeyGenerationTask(kpg,this));
try {
final Image img = Toolkit.getDefaultToolkit().getImage(this.getClass().getClassLoader().getResource("org/neuclear/commons/crypto/passphraseagents/neuclear.png"));
! Canvas canvas = new Canvas() {
! public void paint(Graphics g) {
setSize(50, 50);
g.drawImage(img, 0, 0, this);
--- 85,98 ----
}
agent=new GuiDialogAgent();
! final Panel panel = new Panel();
panel.setLayout(new BorderLayout());
add(panel);
! final Panel text = new Panel(new FlowLayout());
panel.add(text, BorderLayout.NORTH);
keygenTask=new Thread(new KeyGenerationTask(kpg,this));
try {
final Image img = Toolkit.getDefaultToolkit().getImage(this.getClass().getClassLoader().getResource("org/neuclear/commons/crypto/passphraseagents/neuclear.png"));
! final Canvas canvas = new Canvas() {
! public void paint(final Graphics g) {
setSize(50, 50);
g.drawImage(img, 0, 0, this);
***************
*** 106,117 ****
text.add(statusLabel);
! Panel buttons = new Panel(new FlowLayout());
panel.add(buttons, BorderLayout.SOUTH);
ok = new Button("OK");
buttons.add(ok);
! Button cancel = new Button("Cancel");
buttons.add(cancel);
cancel.addActionListener(new ActionListener() {
! public void actionPerformed(ActionEvent actionEvent) {
if (keygenTask!=null)
keygenTask.interrupt();
--- 112,123 ----
text.add(statusLabel);
! final Panel buttons = new Panel(new FlowLayout());
panel.add(buttons, BorderLayout.SOUTH);
ok = new Button("OK");
buttons.add(ok);
! final Button cancel = new Button("Cancel");
buttons.add(cancel);
cancel.addActionListener(new ActionListener() {
! public void actionPerformed(final ActionEvent actionEvent) {
if (keygenTask!=null)
keygenTask.interrupt();
***************
*** 120,125 ****
});
! ActionListener action = new ActionListener() {
! public void actionPerformed(ActionEvent actionEvent) {
ok.setEnabled(false);
keygenTask.run();
--- 126,131 ----
});
! final ActionListener action = new ActionListener() {
! public void actionPerformed(final ActionEvent actionEvent) {
ok.setEnabled(false);
keygenTask.run();
***************
*** 149,157 ****
* @see Applet#stop()
*/
! public void destroy() {
random=null;
}
! void setKp(KeyPair kp) {
publickey=kp.getPublic().getEncoded();
privatekey = kp.getPrivate().getEncoded();
--- 155,163 ----
* @see Applet#stop()
*/
! public final void destroy() {
random=null;
}
! final void setKp(final KeyPair kp) {
publickey=kp.getPublic().getEncoded();
privatekey = kp.getPrivate().getEncoded();
|