|
From: <pe...@us...> - 2003-09-23 19:16:34
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/signers/servlet
In directory sc8-pr-cvs1:/tmp/cvs-serv18509a/src/java/org/neuclear/signers/servlet
Modified Files:
DemoSigningServlet.java SigningServlet.java
Log Message:
Changed NameSpace to Identity.
To cause less confusion in the future.
Index: DemoSigningServlet.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/signers/servlet/DemoSigningServlet.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** DemoSigningServlet.java 22 Sep 2003 19:24:02 -0000 1.2
--- DemoSigningServlet.java 23 Sep 2003 19:16:29 -0000 1.3
***************
*** 2,5 ****
--- 2,9 ----
* $Id$
* $Log$
+ * Revision 1.3 2003/09/23 19:16:29 pelle
+ * Changed NameSpace to Identity.
+ * To cause less confusion in the future.
+ *
* Revision 1.2 2003/09/22 19:24:02 pelle
* More fixes throughout to problems caused by renaming.
***************
*** 28,33 ****
* Revision 1.5 2003/02/14 21:10:36 pelle
* The email sender works. The LogSender and the SoapSender should work but havent been tested yet.
! * The NamedObject has a new log() method that logs it's contents at it's parent NameSpace's logger.
! * The NameSpace object also has a new method send() which allows one to send a named object to the NameSpace's
* default receiver.
*
--- 32,37 ----
* Revision 1.5 2003/02/14 21:10:36 pelle
* The email sender works. The LogSender and the SoapSender should work but havent been tested yet.
! * The NamedObject has a new log() method that logs it's contents at it's parent Identity's logger.
! * The Identity object also has a new method send() which allows one to send a named object to the Identity's
* default receiver.
*
***************
*** 99,105 ****
package org.neuclear.signers.servlet;
! import org.neuclear.id.InvalidNameSpaceException;
import org.neuclear.id.NSTools;
! import org.neuclear.id.NameSpace;
import org.neudist.crypto.signerstores.SignerStore;
import org.neudist.crypto.signerstores.SimpleSignerStore;
--- 103,109 ----
package org.neuclear.signers.servlet;
! import org.neuclear.id.InvalidIdentityException;
import org.neuclear.id.NSTools;
! import org.neuclear.id.Identity;
import org.neudist.crypto.signerstores.SignerStore;
import org.neudist.crypto.signerstores.SimpleSignerStore;
***************
*** 117,121 ****
private void buildTree() throws GeneralSecurityException, NeudistException, IOException {
! System.out.println("NEUDIST: Creating NameSpace Tree");
kpg = KeyPairGenerator.getInstance("RSA");
kpg.initialize(2048, new SecureRandom("Cartagena".getBytes()));
--- 121,125 ----
private void buildTree() throws GeneralSecurityException, NeudistException, IOException {
! System.out.println("NEUDIST: Creating Identity Tree");
kpg = KeyPairGenerator.getInstance("RSA");
kpg.initialize(2048, new SecureRandom("Cartagena".getBytes()));
***************
*** 135,143 ****
private void createNS(String name, String newPassword, PrivateKey signer) throws IOException, NeudistException, GeneralSecurityException {
name = NSTools.normalizeNameURI(name);
! System.out.println("NEUDIST: Generating key and NameSpace for: " + name);
KeyPair kp = kpg.generateKeyPair();
((SimpleSignerStore) getKeyStore()).addKey(name, newPassword.toCharArray(), kp.getPrivate());
! System.out.println("NEUDIST: Creating NameSpace");
! NameSpace ns = new NameSpace(name, kp.getPublic(), "http://neuclear.org:8080/neudistframework/Store", "http://neuclear.org:8080/neudistframework/Signer", "http://neuclear.org:8080/neudistframework/Logger", "");//TODO Fix these values
// id.addTarget(new TargetReference(id,,"store"));
System.out.println("NEUDIST: Signing");
--- 139,147 ----
private void createNS(String name, String newPassword, PrivateKey signer) throws IOException, NeudistException, GeneralSecurityException {
name = NSTools.normalizeNameURI(name);
! System.out.println("NEUDIST: Generating key and Identity for: " + name);
KeyPair kp = kpg.generateKeyPair();
((SimpleSignerStore) getKeyStore()).addKey(name, newPassword.toCharArray(), kp.getPrivate());
! System.out.println("NEUDIST: Creating Identity");
! Identity ns = new Identity(name, kp.getPublic(), "http://neuclear.org:8080/neudistframework/Store", "http://neuclear.org:8080/neudistframework/Signer", "http://neuclear.org:8080/neudistframework/Logger", "");//TODO Fix these values
// id.addTarget(new TargetReference(id,,"store"));
System.out.println("NEUDIST: Signing");
***************
*** 149,154 ****
// getStore().receive(id);//Test locally first
ns.sendObject();
! } catch (InvalidNameSpaceException e) {
! System.out.println("NEUDIST: NameSpace Error: " + e.getLocalizedMessage());
}
}
--- 153,158 ----
// getStore().receive(id);//Test locally first
ns.sendObject();
! } catch (InvalidIdentityException e) {
! System.out.println("NEUDIST: Identity Error: " + e.getLocalizedMessage());
}
}
Index: SigningServlet.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/signers/servlet/SigningServlet.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** SigningServlet.java 22 Sep 2003 19:24:02 -0000 1.2
--- SigningServlet.java 23 Sep 2003 19:16:29 -0000 1.3
***************
*** 2,5 ****
--- 2,9 ----
* $Id$
* $Log$
+ * Revision 1.3 2003/09/23 19:16:29 pelle
+ * Changed NameSpace to Identity.
+ * To cause less confusion in the future.
+ *
* Revision 1.2 2003/09/22 19:24:02 pelle
* More fixes throughout to problems caused by renaming.
***************
*** 25,30 ****
* Revision 1.15 2003/02/14 21:10:36 pelle
* The email sender works. The LogSender and the SoapSender should work but havent been tested yet.
! * The NamedObject has a new log() method that logs it's contents at it's parent NameSpace's logger.
! * The NameSpace object also has a new method send() which allows one to send a named object to the NameSpace's
* default receiver.
*
--- 29,34 ----
* Revision 1.15 2003/02/14 21:10:36 pelle
* The email sender works. The LogSender and the SoapSender should work but havent been tested yet.
! * The NamedObject has a new log() method that logs it's contents at it's parent Identity's logger.
! * The Identity object also has a new method send() which allows one to send a named object to the Identity's
* default receiver.
*
***************
*** 120,124 ****
import org.dom4j.io.OutputFormat;
import org.dom4j.io.XMLWriter;
! import org.neuclear.id.InvalidNameSpaceException;
import org.neuclear.id.NSTools;
import org.neuclear.id.NamedObject;
--- 124,128 ----
import org.dom4j.io.OutputFormat;
import org.dom4j.io.XMLWriter;
! import org.neuclear.id.InvalidIdentityException;
import org.neuclear.id.NSTools;
import org.neuclear.id.NamedObject;
***************
*** 230,235 ****
isSigned = true;
out.println("<br>Done<br>");
! } catch (InvalidNameSpaceException e) {
! out.println("<br><font color=\"red\"><b>ERROR: Invalid NameSpace</b></font><br>");
isSigned = false;
} catch (InvalidPassphraseException e) {
--- 234,239 ----
isSigned = true;
out.println("<br>Done<br>");
! } catch (InvalidIdentityException e) {
! out.println("<br><font color=\"red\"><b>ERROR: Invalid Identity</b></font><br>");
isSigned = false;
} catch (InvalidPassphraseException e) {
***************
*** 237,241 ****
isSigned = false;
} catch (NonExistingSignerException e) {
! out.println("<br><font color=\"red\"><b>ERROR: We Aren't Able to Sign for that NameSpace</b></font><br>");
isSigned = false;
}
--- 241,245 ----
isSigned = false;
} catch (NonExistingSignerException e) {
! out.println("<br><font color=\"red\"><b>ERROR: We Aren't Able to Sign for that Identity</b></font><br>");
isSigned = false;
}
***************
*** 302,306 ****
signObject(obj, "hello".toCharArray());// TODO How do we get the passphrase here? Popup request?
return obj.getElement();
! } catch (InvalidNameSpaceException e) {
throw new SOAPException(e);
} catch (InvalidPassphraseException e) {
--- 306,310 ----
signObject(obj, "hello".toCharArray());// TODO How do we get the passphrase here? Popup request?
return obj.getElement();
! } catch (InvalidIdentityException e) {
throw new SOAPException(e);
} catch (InvalidPassphraseException e) {
***************
*** 313,317 ****
}
! protected static void signObject(NamedObject obj, char passphrase[]) throws NeudistException, InvalidNameSpaceException, InvalidPassphraseException, NonExistingSignerException {
if (!obj.isSigned()) {
try {
--- 317,321 ----
}
! protected static void signObject(NamedObject obj, char passphrase[]) throws NeudistException, InvalidIdentityException, InvalidPassphraseException, NonExistingSignerException {
if (!obj.isSigned()) {
try {
|