|
From: <pe...@us...> - 2003-09-24 23:56:54
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/signrequest
In directory sc8-pr-cvs1:/tmp/cvs-serv524/src/java/org/neuclear/id/signrequest
Modified Files:
SignatureRequest.java
Log Message:
Refactoring nearly done. New model for creating signed objects.
With view for supporting the xmlpull api shortly for performance reasons.
Currently still uses dom4j but that has been refactored out that it
should now be very quick to implement a xmlpull implementation.
A side benefit of this is that the API has been further simplified. I still have some work
todo with regards to cleaning up some of the outlying parts of the code.
Index: SignatureRequest.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/signrequest/SignatureRequest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** SignatureRequest.java 23 Sep 2003 19:16:27 -0000 1.3
--- SignatureRequest.java 24 Sep 2003 23:56:48 -0000 1.4
***************
*** 12,16 ****
import org.dom4j.Element;
import org.dom4j.Namespace;
! import org.neuclear.id.NamedObject;
import org.neuclear.id.NamedObjectFactory;
import org.neudist.crypto.CryptoTools;
--- 12,16 ----
import org.dom4j.Element;
import org.dom4j.Namespace;
! import org.neuclear.id.SignedNamedObject;
import org.neuclear.id.NamedObjectFactory;
import org.neudist.crypto.CryptoTools;
***************
*** 25,33 ****
* Named Object.
*/
! public class SignatureRequest extends NamedObject {
/**
* <p>Used by a website to create an authentication ticket for validation.</p>
* <p>Eg.:<br>
! * <tt>NamedObject ticket=new AuthenticationTicket("neu://test/bob","neu://site/neubay",36000,"http://neubay.com");</tt><br>
* Would give you a namedobject containing the following xml:<br>
* <pre><nsauth:AuthenticationTicket xmlns:nsauth="http://neuclear.org/neu/nsauth" xmlns:nsdl="http://neuclear.org/neu/nsdl" nsdl:name="/test/two/neu.testapp.-2o1qkqrvxyesyt7dae22ulvp56eju30zyys5t6nxjjie2gw3qq" nsauth:validto="20021002T084919848GMT+00:00" nsauth:href="http://localhost:8080/neudistframework/">
--- 25,33 ----
* Named Object.
*/
! public class SignatureRequest extends SignedNamedObject {
/**
* <p>Used by a website to create an authentication ticket for validation.</p>
* <p>Eg.:<br>
! * <tt>SignedNamedObject ticket=new AuthenticationTicket("neu://test/bob","neu://site/neubay",36000,"http://neubay.com");</tt><br>
* Would give you a namedobject containing the following xml:<br>
* <pre><nsauth:AuthenticationTicket xmlns:nsauth="http://neuclear.org/neu/nsauth" xmlns:nsdl="http://neuclear.org/neu/nsdl" nsdl:name="/test/two/neu.testapp.-2o1qkqrvxyesyt7dae22ulvp56eju30zyys5t6nxjjie2gw3qq" nsauth:validto="20021002T084919848GMT+00:00" nsauth:href="http://localhost:8080/neudistframework/">
***************
*** 37,43 ****
* @param reqNameSpace The requesters Identity eg. neu://site/neubay
* @param target URL for interactive signing service to send user to after signing.
! * @param payload the NamedObject to request signing
*/
! private SignatureRequest(String reqNameSpace, String target, NamedObject payload) throws NeudistException {
super(createUniqueTicketName(reqNameSpace, payload.getName()), SignatureRequest.TAG_NAME, SignatureRequest.NS_NSSIGREQ);
addElement(payload);
--- 37,43 ----
* @param reqNameSpace The requesters Identity eg. neu://site/neubay
* @param target URL for interactive signing service to send user to after signing.
! * @param payload the SignedNamedObject to request signing
*/
! private SignatureRequest(String reqNameSpace, String target, SignedNamedObject payload) throws NeudistException {
super(createUniqueTicketName(reqNameSpace, payload.getName()), SignatureRequest.TAG_NAME, SignatureRequest.NS_NSSIGREQ);
addElement(payload);
***************
*** 60,64 ****
}
! public static SignatureRequest createRequest(String requester, String targeturl, NamedObject payload, PrivateKey signer) throws NeudistException {
SignatureRequest req = new SignatureRequest(requester, targeturl, payload);
req.sign(signer);
--- 60,64 ----
}
! public static SignatureRequest createRequest(String requester, String targeturl, SignedNamedObject payload, PrivateKey signer) throws NeudistException {
SignatureRequest req = new SignatureRequest(requester, targeturl, payload);
req.sign(signer);
***************
*** 117,125 ****
}
! public NamedObject getPayload() {
return payload;
}
! private NamedObject payload;
private static final String TAG_NAME = "SignatureRequest";
--- 117,125 ----
}
! public SignedNamedObject getPayload() {
return payload;
}
! private SignedNamedObject payload;
private static final String TAG_NAME = "SignatureRequest";
|