You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(119) |
Oct
(111) |
Nov
(238) |
Dec
(395) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(239) |
Feb
(59) |
Mar
(354) |
Apr
(489) |
May
(23) |
Jun
(2) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
(4) |
May
(5) |
Jun
(2) |
Jul
|
Aug
|
Sep
(3) |
Oct
(14) |
Nov
(17) |
Dec
(9) |
| 2007 |
Jan
(4) |
Feb
(3) |
Mar
|
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
|
Aug
|
Sep
(1) |
Oct
(2) |
Nov
(1) |
Dec
|
| 2008 |
Jan
|
Feb
|
Mar
(1) |
Apr
(7) |
May
(3) |
Jun
(6) |
Jul
(4) |
Aug
(3) |
Sep
(15) |
Oct
(13) |
Nov
(35) |
Dec
(40) |
| 2009 |
Jan
(19) |
Feb
(21) |
Mar
(16) |
Apr
(18) |
May
(36) |
Jun
(20) |
Jul
(32) |
Aug
(11) |
Sep
(3) |
Oct
(2) |
Nov
(2) |
Dec
(13) |
| 2010 |
Jan
(5) |
Feb
(5) |
Mar
(7) |
Apr
(1) |
May
(1) |
Jun
(3) |
Jul
(1) |
Aug
(1) |
Sep
(1) |
Oct
(1) |
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
(1) |
Aug
(1) |
Sep
(1) |
Oct
(4) |
Nov
|
Dec
(3) |
| 2012 |
Jan
(3) |
Feb
(3) |
Mar
(1) |
Apr
(4) |
May
(8) |
Jun
(4) |
Jul
(9) |
Aug
(2) |
Sep
(8) |
Oct
(3) |
Nov
(8) |
Dec
(4) |
| 2013 |
Jan
(2) |
Feb
(1) |
Mar
(5) |
Apr
(6) |
May
(10) |
Jun
(5) |
Jul
(6) |
Aug
(7) |
Sep
(5) |
Oct
(2) |
Nov
(4) |
Dec
(4) |
| 2014 |
Jan
(13) |
Feb
(4) |
Mar
(7) |
Apr
(9) |
May
(20) |
Jun
(13) |
Jul
(10) |
Aug
(3) |
Sep
(5) |
Oct
(2) |
Nov
(2) |
Dec
(2) |
| 2015 |
Jan
(3) |
Feb
(3) |
Mar
(5) |
Apr
(4) |
May
(3) |
Jun
(2) |
Jul
(4) |
Aug
(3) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
(3) |
| 2016 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
(1) |
Aug
(4) |
Sep
(3) |
Oct
(3) |
Nov
(4) |
Dec
(2) |
| 2017 |
Jan
|
Feb
(2) |
Mar
|
Apr
(2) |
May
(1) |
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <pe...@us...> - 2004-02-19 15:40:51
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/targets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16761/src/java/org/neuclear/id/targets Modified Files: Target.java Log Message: Various cleanups and corrections Index: Target.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/targets/Target.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Target.java 18 Feb 2004 00:14:31 -0000 1.1 --- Target.java 19 Feb 2004 15:30:20 -0000 1.2 *************** *** 25,28 **** --- 25,31 ---- $Id$ $Log$ + Revision 1.2 2004/02/19 15:30:20 pelle + Various cleanups and corrections + Revision 1.1 2004/02/18 00:14:31 pelle Many, many clean ups. I've readded Targets in a new method. *************** *** 35,39 **** */ final class Target { ! private Target( int type, String href) { this.href = href; this.type = type; --- 38,42 ---- */ final class Target { ! private Target(int type, String href) { this.href = href; this.type = type; *************** *** 48,65 **** } ! final static Target make(String type,String href){ int t = getType(type); ! return new Target(t,href); } final static int getType(String type) { ! int t=0; ! if (type!=null&&typemap.containsKey(type)) ! t=((Byte)typemap.get(type)).byteValue(); return t; } ! final static Target parseElement(Element elem){ ! return make(elem.attributeValue("type"),elem.getTextTrim()); } --- 51,68 ---- } ! final static Target make(String type, String href) { int t = getType(type); ! return new Target(t, href); } final static int getType(String type) { ! int t = 0; ! if (type != null && TYPEMAP.containsKey(type)) ! t = ((Byte) TYPEMAP.get(type)).byteValue(); return t; } ! final static Target parseElement(Element elem) { ! return make(elem.attributeValue("type"), elem.getTextTrim()); } *************** *** 67,77 **** private final int type; ! private final static HashMap typemap=new HashMap(); - // Add further standard types here - private final static String[] types= new String[] {"misc","auditor","receiver","logger"}; { ! for(byte i=0;i<types.length;i++) ! typemap.put(types[i],new Byte(i)); } } --- 70,81 ---- private final int type; ! private final static HashMap TYPEMAP = new HashMap(); ! ! // Add further standard TYPES here ! private final static String[] TYPES = new String[]{"misc", "auditor", "receiver", "logger"}; { ! for (byte i = 0; i < TYPES.length; i++) ! TYPEMAP.put(TYPES[i], new Byte(i)); } } |
|
From: <pe...@us...> - 2004-02-19 15:40:51
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/resolver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16761/src/java/org/neuclear/id/resolver Modified Files: NSResolver.java Log Message: Various cleanups and corrections Index: NSResolver.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/resolver/NSResolver.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** NSResolver.java 18 Feb 2004 00:14:31 -0000 1.19 --- NSResolver.java 19 Feb 2004 15:30:20 -0000 1.20 *************** *** 22,25 **** --- 22,28 ---- */ public final class NSResolver { + private NSResolver() { //Dont Instantiate + } + private static final NSCache NSCACHE = new NSCache(); *************** *** 76,80 **** return VerifyingReader.getInstance().read(new URL(name).openStream()); } catch (IOException e) { ! throw new InvalidNamedObjectException(name,e); } } --- 79,83 ---- return VerifyingReader.getInstance().read(new URL(name).openStream()); } catch (IOException e) { ! throw new InvalidNamedObjectException(name, e); } } |
|
From: <pe...@us...> - 2004-02-19 15:40:51
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/verifier In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16761/src/java/org/neuclear/id/verifier Modified Files: VerifyingReader.java Log Message: Various cleanups and corrections Index: VerifyingReader.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/verifier/VerifyingReader.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** VerifyingReader.java 10 Jan 2004 00:03:20 -0000 1.18 --- VerifyingReader.java 19 Feb 2004 15:30:21 -0000 1.19 *************** *** 31,34 **** --- 31,37 ---- $Id$ $Log$ + Revision 1.19 2004/02/19 15:30:21 pelle + Various cleanups and corrections + Revision 1.18 2004/01/10 00:03:20 pelle Implemented new Schema for Transfer* *************** *** 162,166 **** public static VerifyingReader getInstance() { ! return instance; } --- 165,169 ---- public static VerifyingReader getInstance() { ! return INSTANCE; } *************** *** 168,174 **** * Read Object from input stream. * Verify signature with parent Identity ! * ! * @param is ! * @return * @throws InvalidNamedObjectException */ --- 171,177 ---- * Read Object from input stream. * Verify signature with parent Identity ! * ! * @param is ! * @return * @throws InvalidNamedObjectException */ *************** *** 182,186 **** } ! public final SignedNamedObject read(final Element elem) throws InvalidNamedObjectException, NameResolutionException{ return resolveReader(elem).read(SignedNamedCore.read(elem), elem); } --- 185,189 ---- } ! public final SignedNamedObject read(final Element elem) throws InvalidNamedObjectException, NameResolutionException { return resolveReader(elem).read(SignedNamedCore.read(elem), elem); } *************** *** 202,205 **** private final Map readers; private final NamedObjectReader defaultReader; ! private static final VerifyingReader instance = new VerifyingReader(); } --- 205,208 ---- private final Map readers; private final NamedObjectReader defaultReader; ! private static final VerifyingReader INSTANCE = new VerifyingReader(); } |
|
From: <pe...@us...> - 2004-02-19 15:40:39
|
Update of /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/soap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16698/src/java/org/neuclear/xml/soap Modified Files: SOAPTools.java Log Message: Various cleanups and corrections Index: SOAPTools.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/soap/SOAPTools.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SOAPTools.java 12 Dec 2003 12:32:49 -0000 1.6 --- SOAPTools.java 19 Feb 2004 15:30:08 -0000 1.7 *************** *** 1,4 **** --- 1,7 ---- /* $Id$ * $Log$ + * Revision 1.7 2004/02/19 15:30:08 pelle + * Various cleanups and corrections + * * Revision 1.6 2003/12/12 12:32:49 pelle * Working on getting the SOAPServletTest working under cactus *************** *** 118,122 **** */ - import org.dom4j.*; import org.dom4j.io.SAXReader; import org.neuclear.commons.NeuClearException; --- 121,124 ---- *************** *** 129,132 **** --- 131,136 ---- public final class SOAPTools { + private SOAPTools() { + } *************** *** 195,202 **** public static Element soapRequestElement(final URLConnection conn, final Element request, final String soapAction) throws NeuClearException, IOException { try { ! final BufferedReader in = new BufferedReader( ! new InputStreamReader( ! soapRequest(conn, request, soapAction) ! )); final SAXReader reader = new SAXReader(); final Document document = reader.read(in); --- 199,203 ---- public static Element soapRequestElement(final URLConnection conn, final Element request, final String soapAction) throws NeuClearException, IOException { try { ! final BufferedReader in = new BufferedReader(new InputStreamReader(soapRequest(conn, request, soapAction))); final SAXReader reader = new SAXReader(); final Document document = reader.read(in); |
|
From: <pe...@us...> - 2004-02-19 15:40:39
|
Update of /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/xmlsec In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16698/src/java/org/neuclear/xml/xmlsec Modified Files: XMLSecTools.java Removed Files: QuickEmbeddedSignature.java Log Message: Various cleanups and corrections Index: XMLSecTools.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/xmlsec/XMLSecTools.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** XMLSecTools.java 19 Feb 2004 00:27:59 -0000 1.9 --- XMLSecTools.java 19 Feb 2004 15:30:09 -0000 1.10 *************** *** 1,4 **** --- 1,7 ---- /* $Id$ * $Log$ + * Revision 1.10 2004/02/19 15:30:09 pelle + * Various cleanups and corrections + * * Revision 1.9 2004/02/19 00:27:59 pelle * Discovered several incompatabilities with the xmlsig implementation. Have been working on getting it working. *************** *** 160,164 **** */ - import org.dom4j.*; import org.dom4j.io.XMLWriter; import org.neuclear.commons.crypto.Base64; --- 163,166 ---- *************** *** 190,193 **** --- 192,198 ---- */ public final class XMLSecTools { + private XMLSecTools() { + } + public static final String XMLDSIG_NAMESPACE = "http://www.w3.org/2000/09/xmldsig#"; public static final Namespace NS_DS = DocumentHelper.createNamespace("ds", XMLDSIG_NAMESPACE); *************** *** 209,225 **** /** * Signs an element with a given Private Key and "Envelopes" the signature within. ! * ! * @param root Element to be signed ! * @param name Alias of key to be used for signing ! * @param signer NeuClear Signer ! * @throws XMLSecurityException */ ! public static XMLSignature signElement( final Element root, final String name, final org.neuclear.commons.crypto.signers.Signer signer) throws XMLSecurityException, NonExistingSignerException, UserCancellationException {//, KeyStoreException { ! return new XMLSignature(name, signer, root,Reference.XMLSIGTYPE_ENVELOPED); } /** * Signs an element with a given keypair and embeds the element within the Signature. ! * * @param root Element to be signed * @param keypair RSA/DSA KeyPair --- 214,230 ---- /** * Signs an element with a given Private Key and "Envelopes" the signature within. ! * ! * @param root Element to be signed ! * @param name Alias of key to be used for signing ! * @param signer NeuClear Signer ! * @throws XMLSecurityException */ ! public static XMLSignature signElement(final Element root, final String name, final org.neuclear.commons.crypto.signers.Signer signer) throws XMLSecurityException, NonExistingSignerException, UserCancellationException {//, KeyStoreException { ! return new XMLSignature(name, signer, root, Reference.XMLSIGTYPE_ENVELOPED); } /** * Signs an element with a given keypair and embeds the element within the Signature. ! * * @param root Element to be signed * @param keypair RSA/DSA KeyPair *************** *** 393,397 **** */ public static byte[] canonicalize(final Canonicalizer canon, final Object node) throws XMLSecurityException { ! return canon.canonicalize(node); } --- 398,402 ---- */ public static byte[] canonicalize(final Canonicalizer canon, final Object node) throws XMLSecurityException { ! return canon.canonicalize(node); } *************** *** 487,492 **** * @return Text */ ! public static Text createTextWithBigInteger( ! final BigInteger biginteger) { String encodedInt = Base64.encode(biginteger); --- 492,496 ---- * @return Text */ ! public static Text createTextWithBigInteger(final BigInteger biginteger) { String encodedInt = Base64.encode(biginteger); --- QuickEmbeddedSignature.java DELETED --- |
|
From: <pe...@us...> - 2004-02-19 15:40:39
|
Update of /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/transforms In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16698/src/java/org/neuclear/xml/transforms Modified Files: DropSignatureTransform.java XPathTransform.java Log Message: Various cleanups and corrections Index: DropSignatureTransform.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/transforms/DropSignatureTransform.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DropSignatureTransform.java 21 Nov 2003 04:44:30 -0000 1.2 --- DropSignatureTransform.java 19 Feb 2004 15:30:08 -0000 1.3 *************** *** 1,3 **** --- 1,4 ---- package org.neuclear.xml.transforms; + /** * (C) 2003 Antilles Software Ventures SA *************** *** 7,10 **** --- 8,14 ---- * $Id$ * $Log$ + * Revision 1.3 2004/02/19 15:30:08 pelle + * Various cleanups and corrections + * * Revision 1.2 2003/11/21 04:44:30 pelle * EncryptedFileStore now works. It uses the PBECipher with DES3 afair. *************** *** 35,39 **** */ - import org.dom4j.*; import org.neuclear.xml.xmlsec.XMLSecTools; import org.neuclear.xml.xmlsec.XMLSecurityException; --- 39,42 ---- *************** *** 41,45 **** import java.util.ListIterator; ! public final class DropSignatureTransform extends Transform{ public DropSignatureTransform() { super(ALGORITHM); --- 44,48 ---- import java.util.ListIterator; ! public final class DropSignatureTransform extends Transform { public DropSignatureTransform() { super(ALGORITHM); *************** *** 52,62 **** public final Object transformNode(final Object in) { ! if (in instanceof Document){ ! transformNode(((Document)in).getRootElement()); ! } else if (in instanceof Element){ ! final ListIterator iter=((Branch)in).content().listIterator(); ! while(iter.hasNext()) { ! final Node node=(Node)iter.next(); ! if ((node instanceof Element)&&(((Element)node).getQName().equals(subject)) ) iter.remove(); // else if (node instanceof Branch) { --- 55,65 ---- public final Object transformNode(final Object in) { ! if (in instanceof Document) { ! transformNode(((Document) in).getRootElement()); ! } else if (in instanceof Element) { ! final ListIterator iter = ((Branch) in).content().listIterator(); ! while (iter.hasNext()) { ! final Node node = (Node) iter.next(); ! if ((node instanceof Element) && (((Element) node).getQName().equals(SUBJECT))) iter.remove(); // else if (node instanceof Branch) { *************** *** 65,74 **** } } ! return in; } ! private static final QName subject=XMLSecTools.createQName("Signature"); ! public static final String ALGORITHM="http://www.w3.org/2000/09/xmldsig#enveloped-signature"; { ! TransformerFactory.registerTransformer(ALGORITHM,DropSignatureTransform.class); } } --- 68,79 ---- } } ! return in; } ! ! private static final QName SUBJECT = XMLSecTools.createQName("Signature"); ! public static final String ALGORITHM = "http://www.w3.org/2000/09/xmldsig#enveloped-signature"; ! { ! TransformerFactory.registerTransformer(ALGORITHM, DropSignatureTransform.class); } } Index: XPathTransform.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/transforms/XPathTransform.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** XPathTransform.java 21 Nov 2003 04:44:30 -0000 1.2 --- XPathTransform.java 19 Feb 2004 15:30:08 -0000 1.3 *************** *** 1,12 **** package org.neuclear.xml.transforms; - import org.dom4j.*; - import org.neuclear.xml.xmlsec.XMLSecurityException; import org.neuclear.xml.xmlsec.XMLSecTools; - import java.util.ListIterator; - import java.util.Map; import java.util.HashMap; import java.util.List; /** --- 1,11 ---- package org.neuclear.xml.transforms; import org.neuclear.xml.xmlsec.XMLSecTools; + import org.neuclear.xml.xmlsec.XMLSecurityException; import java.util.HashMap; import java.util.List; + import java.util.ListIterator; + import java.util.Map; /** *************** *** 21,37 **** super(ALGORITHM); } public XPathTransform(final String xpath) { super(ALGORITHM); // this.xpath=xpath; setXPath(xpath); ! final Element xpElem=getElement().addElement("XPath"); xpElem.setText(xpath); ! xpElem.addAttribute("xmlns:dsig","&dsig;"); } private void setXPath(final String xpath) { // XPathFilter=DocumentHelper.createXPath(xpath); ! xpathFilter=DocumentHelper.createXPath(xpath); ! xpathFilter.setNamespaceURIs(nsmap); // try { --- 20,37 ---- super(ALGORITHM); } + public XPathTransform(final String xpath) { super(ALGORITHM); // this.xpath=xpath; setXPath(xpath); ! final Element xpElem = getElement().addElement("XPath"); xpElem.setText(xpath); ! xpElem.addAttribute("xmlns:dsig", "&dsig;"); } private void setXPath(final String xpath) { // XPathFilter=DocumentHelper.createXPath(xpath); ! xpathFilter = DocumentHelper.createXPath(xpath); ! xpathFilter.setNamespaceURIs(NSMAP); // try { *************** *** 45,52 **** public XPathTransform(final Element elem) throws XMLSecurityException { super(elem); ! final Element xpElement=elem.element("XPath"); ! if (xpElement==null) throw new XMLSecurityException("XPath Element not found in Tranform"); ! final String xpath=xpElement.getTextTrim(); setXPath(xpath); } --- 45,52 ---- public XPathTransform(final Element elem) throws XMLSecurityException { super(elem); ! final Element xpElement = elem.element("XPath"); ! if (xpElement == null) throw new XMLSecurityException("XPath Element not found in Tranform"); ! final String xpath = xpElement.getTextTrim(); setXPath(xpath); } *************** *** 54,97 **** public final Object transformNode(final Object in) { // XPath needs a document. So if element doesnt have one we add it. ! if (in instanceof Element){ ! if (((Element)in).getDocument()==null){ ! DocumentHelper.createDocument((Element)in); } } ! if ((in instanceof Node)&&!matches((Node)in)) { ! return null; } ! ListIterator iter=null; if (in instanceof List) ! iter=((List)in).listIterator(); else if (in instanceof Branch) ! iter=((Branch)in).content().listIterator(); ! if (iter!=null) { while (iter.hasNext()) { final Node node = (Node) iter.next(); ! if (transformNode(node)==null) ! iter.remove(); } } return in; } ! public final boolean matches(final Node node){ return xpathFilter.matches(node); } ! // private String xpath; private XPath xpathFilter; // private BaseXPath xp; //private XPath xpath; ! public static final String ALGORITHM="http://www.w3.org/TR/1999/REC-xpath-19991116"; { ! TransformerFactory.registerTransformer(ALGORITHM,XPathTransform.class); } ! private static final Map nsmap=new HashMap(); { ! nsmap.put("ds",XMLSecTools.XMLDSIG_NAMESPACE); } } --- 54,101 ---- public final Object transformNode(final Object in) { // XPath needs a document. So if element doesnt have one we add it. ! if (in instanceof Element) { ! if (((Element) in).getDocument() == null) { ! DocumentHelper.createDocument((Element) in); } } ! if ((in instanceof Node) && !matches((Node) in)) { ! return null; } ! ListIterator iter = null; if (in instanceof List) ! iter = ((List) in).listIterator(); else if (in instanceof Branch) ! iter = ((Branch) in).content().listIterator(); ! if (iter != null) { while (iter.hasNext()) { final Node node = (Node) iter.next(); ! if (transformNode(node) == null) ! iter.remove(); } } return in; } ! ! public final boolean matches(final Node node) { return xpathFilter.matches(node); } ! ! // private String xpath; private XPath xpathFilter; // private BaseXPath xp; //private XPath xpath; ! public static final String ALGORITHM = "http://www.w3.org/TR/1999/REC-xpath-19991116"; ! { ! TransformerFactory.registerTransformer(ALGORITHM, XPathTransform.class); } ! private static final Map NSMAP = new HashMap(); ! { ! NSMAP.put("ds", XMLSecTools.XMLDSIG_NAMESPACE); } } |
|
From: <pe...@us...> - 2004-02-19 15:40:38
|
Update of /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/c14 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16698/src/java/org/neuclear/xml/c14 Modified Files: Canonicalizer.java Log Message: Various cleanups and corrections Index: Canonicalizer.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/c14/Canonicalizer.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Canonicalizer.java 19 Feb 2004 00:27:59 -0000 1.7 --- Canonicalizer.java 19 Feb 2004 15:30:08 -0000 1.8 *************** *** 8,11 **** --- 8,14 ---- * $Id$ * $Log$ + * Revision 1.8 2004/02/19 15:30:08 pelle + * Various cleanups and corrections + * * Revision 1.7 2004/02/19 00:27:59 pelle * Discovered several incompatabilities with the xmlsig implementation. Have been working on getting it working. *************** *** 119,123 **** */ - import org.dom4j.*; import org.dom4j.tree.NamespaceStack; import org.neuclear.xml.ElementProxy; --- 122,125 ---- *************** *** 513,517 **** public final static int C14NTYPE_NORMAL = 0; public final static int C14NTYPE_WITH_COMMENTS = 1; ! private final static Charset utf8 = Charset.forName("UTF-8"); public static final String ALGORITHM = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315"; --- 515,519 ---- public final static int C14NTYPE_NORMAL = 0; public final static int C14NTYPE_WITH_COMMENTS = 1; ! private final static Charset UTF8 = Charset.forName("UTF-8"); public static final String ALGORITHM = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315"; |
|
From: <pe...@us...> - 2004-02-19 15:40:27
|
Update of /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/keyresolvers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16429/src/java/org/neuclear/commons/crypto/keyresolvers Modified Files: KeyResolverFactory.java Log Message: Various cleanups and corrections Index: KeyResolverFactory.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/keyresolvers/KeyResolverFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** KeyResolverFactory.java 14 Jan 2004 16:34:07 -0000 1.2 --- KeyResolverFactory.java 19 Feb 2004 15:29:09 -0000 1.3 *************** *** 23,26 **** --- 23,29 ---- $Id$ $Log$ + Revision 1.3 2004/02/19 15:29:09 pelle + Various cleanups and corrections + Revision 1.2 2004/01/14 16:34:07 pelle New model of references and signatures now pretty much works. *************** *** 42,50 **** */ public class KeyResolverFactory { ! public synchronized final static KeyResolver getInstance(){ ! if (instance==null){ ! String impl=System.getProperty("org.neuclear.commons.crypto.keyresolvers.default"); if (Utility.isEmpty(impl)) ! impl=DEFAULT; try { instance = (KeyResolver) Class.forName(impl).newInstance(); --- 45,56 ---- */ public class KeyResolverFactory { ! private KeyResolverFactory() { ! } ! ! public synchronized final static KeyResolver getInstance() { ! if (instance == null) { ! String impl = System.getProperty("org.neuclear.commons.crypto.keyresolvers.default"); if (Utility.isEmpty(impl)) ! impl = DEFAULT; try { instance = (KeyResolver) Class.forName(impl).newInstance(); *************** *** 61,65 **** } ! public final static String DEFAULT="org.neuclear.commons.crypto.keyresolvers.NullResolver"; private static KeyResolver instance; } --- 67,71 ---- } ! public final static String DEFAULT = "org.neuclear.commons.crypto.keyresolvers.NullResolver"; private static KeyResolver instance; } |
|
From: <pe...@us...> - 2004-02-19 15:40:13
|
Update of /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/time In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16429/src/java/org/neuclear/commons/time Modified Files: TimeTools.java Log Message: Various cleanups and corrections Index: TimeTools.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/time/TimeTools.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TimeTools.java 3 Jan 2004 20:36:33 -0000 1.8 --- TimeTools.java 19 Feb 2004 15:29:11 -0000 1.9 *************** *** 2,5 **** --- 2,8 ---- * $Id$ * $Log$ + * Revision 1.9 2004/02/19 15:29:11 pelle + * Various cleanups and corrections + * * Revision 1.8 2004/01/03 20:36:33 pelle * Renamed HeldTransfer to Exchange *************** *** 78,82 **** package org.neuclear.commons.time; - import org.neuclear.commons.NeuClearException; import org.neuclear.commons.Utility; --- 81,84 ---- *************** *** 95,98 **** --- 97,102 ---- public final class TimeTools { + private TimeTools() { + } *************** *** 134,138 **** if (Utility.isEmpty(ts)) return null; ! return convertDateToTimestamp(getDateFormatter().parse(ts)); } --- 138,142 ---- if (Utility.isEmpty(ts)) return null; ! return convertDateToTimestamp(getDateFormatter().parse(ts)); } *************** *** 141,144 **** --- 145,149 ---- return getDateFormatter().format(time); } + public static String formatTimeStampShort(final Date time) { return DFS.format(time); *************** *** 148,156 **** return DF; } ! public static Date get2020(){ ! Calendar calendar=Calendar.getInstance(); ! calendar.set(2020,0,0,0,0,0); return calendar.getTime(); } /** * Base ISO 8601 Date format yyyy-MM-ddTHH:mm:ss,SSSzzz i.e., 2002-12-25T14:32:12,333-500 for --- 153,163 ---- return DF; } ! ! public static Date get2020() { ! Calendar calendar = Calendar.getInstance(); ! calendar.set(2020, 0, 0, 0, 0, 0); return calendar.getTime(); } + /** * Base ISO 8601 Date format yyyy-MM-ddTHH:mm:ss,SSSzzz i.e., 2002-12-25T14:32:12,333-500 for *************** *** 174,177 **** --- 181,185 ---- * Really just a simple placeholder. * Eventually this should return UTC current time. + * * @return */ |
|
From: <pe...@us...> - 2004-02-19 15:40:13
|
Update of /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16429/src/java/org/neuclear/commons/test Modified Files: JunitTools.java Log Message: Various cleanups and corrections Index: JunitTools.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/test/JunitTools.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** JunitTools.java 21 Nov 2003 04:43:42 -0000 1.3 --- JunitTools.java 19 Feb 2004 15:29:10 -0000 1.4 *************** *** 20,23 **** --- 20,26 ---- * $Id$ * $Log$ + * Revision 1.4 2004/02/19 15:29:10 pelle + * Various cleanups and corrections + * * Revision 1.3 2003/11/21 04:43:42 pelle * EncryptedFileStore now works. It uses the PBECipher with DES3 afair. *************** *** 25,29 **** * 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.2 2003/11/20 23:41:36 pelle * Getting all the tests to work in id --- 28,32 ---- * 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). ! * <p/> * Revision 1.2 2003/11/20 23:41:36 pelle * Getting all the tests to work in id *************** *** 31,35 **** * First version of EntityLedger that will use OFB's EntityEngine. This will allow us to support a vast amount databases without * writing SQL. (Yipee) ! * * Revision 1.1 2003/11/11 21:17:48 pelle * Further vital reshuffling. --- 34,38 ---- * First version of EntityLedger that will use OFB's EntityEngine. This will allow us to support a vast amount databases without * writing SQL. (Yipee) ! * <p/> * Revision 1.1 2003/11/11 21:17:48 pelle * Further vital reshuffling. *************** *** 44,47 **** --- 47,53 ---- */ public final class JunitTools { + private JunitTools() { + } + private static void loadKeys() throws CryptoException { try { |
|
From: <pe...@us...> - 2004-02-19 15:40:13
|
Update of /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16429/src/java/org/neuclear/commons/crypto Modified Files: Base64.java CryptoTools.java Log Message: Various cleanups and corrections Index: Base64.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/Base64.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Base64.java 19 Feb 2004 00:27:34 -0000 1.4 --- Base64.java 19 Feb 2004 15:29:10 -0000 1.5 *************** *** 1,4 **** --- 1,7 ---- /* $Id$ * $Log$ + * Revision 1.5 2004/02/19 15:29:10 pelle + * Various cleanups and corrections + * * Revision 1.4 2004/02/19 00:27:34 pelle * Discovered several incompatabilities with the xmlsig implementation. Have been working on getting it working. *************** *** 61,64 **** --- 64,68 ---- */ package org.neuclear.commons.crypto; + import java.math.BigInteger; *************** *** 79,90 **** public final class Base64 { ! /** Field LINE_SEPARATOR */ public static final String LINE_SEPARATOR = "\n"; ! /** Field BASE64DEFAULTLENGTH */ public static final int BASE64DEFAULTLENGTH = 76; - /** Field _base64length */ - static final int _base64length = Base64.BASE64DEFAULTLENGTH; private Base64() { --- 83,96 ---- public final class Base64 { ! /** ! * Field LINE_SEPARATOR ! */ public static final String LINE_SEPARATOR = "\n"; ! /** ! * Field BASE64DEFAULTLENGTH ! */ public static final int BASE64DEFAULTLENGTH = 76; private Base64() { *************** *** 99,103 **** */ public static int getBase64WrapLength() { ! return Base64._base64length; } --- 105,109 ---- */ public static int getBase64WrapLength() { ! return BASE64DEFAULTLENGTH; } *************** *** 105,109 **** * Returns a byte-array representation of a <code>{@link java.math.BigInteger}<code>. * No sign-bit is outputed. ! * * <p><b>N.B.:</B> <code>{@link java.math.BigInteger}<code>'s toByteArray * retunrs eventually longer arrays because of the leading sign-bit. --- 111,115 ---- * Returns a byte-array representation of a <code>{@link java.math.BigInteger}<code>. * No sign-bit is outputed. ! * <p/> * <p><b>N.B.:</B> <code>{@link java.math.BigInteger}<code>'s toByteArray * retunrs eventually longer arrays because of the leading sign-bit. *************** *** 114,118 **** public static byte[] getBytes(final BigInteger big) { ! int bitlen= big.bitLength(); //round bitlen bitlen = ((bitlen + 7) >> 3) << 3; --- 120,124 ---- public static byte[] getBytes(final BigInteger big) { ! int bitlen = big.bitLength(); //round bitlen bitlen = ((bitlen + 7) >> 3) << 3; *************** *** 162,166 **** public static String encodeClean(final byte[] bytes) { ! return LINE_SEPARATOR+ encode(bytes,76)+LINE_SEPARATOR; } --- 168,172 ---- public static String encodeClean(final byte[] bytes) { ! return LINE_SEPARATOR + encode(bytes, BASE64DEFAULTLENGTH) + LINE_SEPARATOR; } *************** *** 169,175 **** * Method decodeBase64Element * - * * @param base64 - * * @return */ --- 175,179 ---- *************** *** 193,202 **** * wrapped line</p> * ! * @param raw <code>byte[]</code> data to be encoded * @param wrap <code>int<code> length of wrapped lines; No wrapping if less than 4. * @return a <code>String</code> with encoded data */ public static String encode(final byte[] raw, final int wrap) { ! final byte[] b64=org.bouncycastle.util.encoders.Base64.encode(raw); //calculate length of encoded string --- 197,206 ---- * wrapped line</p> * ! * @param raw <code>byte[]</code> data to be encoded * @param wrap <code>int<code> length of wrapped lines; No wrapping if less than 4. * @return a <code>String</code> with encoded data */ public static String encode(final byte[] raw, final int wrap) { ! final byte[] b64 = org.bouncycastle.util.encoders.Base64.encode(raw); //calculate length of encoded string *************** *** 205,215 **** final int lines = (encLen / wrap); ! final byte[] encoded = new byte[encLen+lines]; ! int sx=0,dx=0; ! for (sx = 0; sx < (lines*wrap); sx+=wrap,dx+=(wrap+1)) { ! System.arraycopy(b64,sx,encoded, dx,wrap); ! encoded[dx+wrap]='\n'; } ! System.arraycopy(b64,sx,encoded, dx,encLen-sx); --- 209,219 ---- final int lines = (encLen / wrap); ! final byte[] encoded = new byte[encLen + lines]; ! int sx = 0, dx = 0; ! for (sx = 0; sx < (lines * wrap); sx += wrap, dx += (wrap + 1)) { ! System.arraycopy(b64, sx, encoded, dx, wrap); ! encoded[dx + wrap] = '\n'; } ! System.arraycopy(b64, sx, encoded, dx, encLen - sx); Index: CryptoTools.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/CryptoTools.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** CryptoTools.java 18 Feb 2004 00:13:41 -0000 1.13 --- CryptoTools.java 19 Feb 2004 15:29:10 -0000 1.14 *************** *** 2,5 **** --- 2,8 ---- * $Id$ * $Log$ + * Revision 1.14 2004/02/19 15:29:10 pelle + * Various cleanups and corrections + * * Revision 1.13 2004/02/18 00:13:41 pelle * Many, many clean ups. I've readded Targets in a new method. *************** *** 266,269 **** --- 269,274 ---- public final class CryptoTools { + private CryptoTools() { + } *************** *** 316,319 **** --- 321,325 ---- return null; } + public static PublicKey getPublicKeyFromBase64(final String b64) throws CryptoException { try { *************** *** 337,342 **** h = 2 * i; final byte src = barray[i]; ! hexarray[h] = hexTable[(src & 0xF0) >> 4]; ! hexarray[h + 1] = hexTable[src & 0x0F]; } --- 343,348 ---- h = 2 * i; final byte src = barray[i]; ! hexarray[h] = HEX_TABLE[(src & 0xF0) >> 4]; ! hexarray[h + 1] = HEX_TABLE[src & 0x0F]; } *************** *** 360,373 **** } - public static byte[] getHash(final String value) throws CryptoException { - try { - final MessageDigest dig = MessageDigest.getInstance("SHA1"); - dig.digest(value.getBytes()); - return dig.digest(); - } catch (NoSuchAlgorithmException e) { - rethrowException(e); - return null; - } - } //Quick Hack. Not very efficient I know. --- 366,369 ---- *************** *** 425,429 **** rethrowException(e); } ! return null; } --- 421,425 ---- rethrowException(e); } ! return new byte[0]; } *************** *** 466,470 **** rethrowException(e); } ! return null; } --- 462,466 ---- rethrowException(e); } ! return new byte[0]; } *************** *** 508,511 **** --- 504,508 ---- return digest(dig, value); } + public static byte[] digest(final String value) { return digest(value.getBytes()); *************** *** 542,548 **** --- 539,547 ---- return true; } + /** * Unpadded Base32 Encoding as defined in: * <a href="http://www.waterken.com/dev/Enc/base32/">http://www.waterken.com/dev/Enc/base32/</a> + * * @param val * @return *************** *** 607,618 **** * */ ! public static Cipher makePBECipher( ! final String algorithm, ! final int mode, ! final char[] password, ! final byte[] salt, ! final int iterationCount, ! final String provider ! ) throws GeneralSecurityException { final PBEKeySpec pbeSpec = new PBEKeySpec(password); final SecretKeyFactory keyFact = SecretKeyFactory.getInstance(algorithm, provider); --- 606,615 ---- * */ ! public static Cipher makePBECipher(final String algorithm, ! final int mode, ! final char[] password, ! final byte[] salt, ! final int iterationCount, ! final String provider) throws GeneralSecurityException { final PBEKeySpec pbeSpec = new PBEKeySpec(password); final SecretKeyFactory keyFact = SecretKeyFactory.getInstance(algorithm, provider); *************** *** 638,647 **** * */ ! public static Cipher makePBECipher( ! final int mode, ! final char[] password, ! final byte[] salt, ! final int iterationCount ! ) throws GeneralSecurityException { return makePBECipher(DEFAULT_PBE_ALGORITHM, mode, password, salt, iterationCount, DEFAULT_JCE_PROVIDER); } --- 635,642 ---- * */ ! public static Cipher makePBECipher(final int mode, ! final char[] password, ! final byte[] salt, ! final int iterationCount) throws GeneralSecurityException { return makePBECipher(DEFAULT_PBE_ALGORITHM, mode, password, salt, iterationCount, DEFAULT_JCE_PROVIDER); } *************** *** 657,664 **** * */ ! public static Cipher makePBECipher( ! final int mode, ! final char[] password ! ) throws GeneralSecurityException { return makePBECipher(DEFAULT_PBE_ALGORITHM, mode, password, DEFAULT_SALT, DEFAULT_ITERATION_COUNT, DEFAULT_JCE_PROVIDER); } --- 652,657 ---- * */ ! public static Cipher makePBECipher(final int mode, ! final char[] password) throws GeneralSecurityException { return makePBECipher(DEFAULT_PBE_ALGORITHM, mode, password, DEFAULT_SALT, DEFAULT_ITERATION_COUNT, DEFAULT_JCE_PROVIDER); } *************** *** 701,704 **** --- 694,698 ---- } + public static KeyPairGenerator getTinyKeyPairGenerator() throws NoSuchAlgorithmException { if (kg == null) { *************** *** 751,755 **** || (asn1Bytes[2] != 2) || (i > 20) || (asn1Bytes[4 + rLength] != 2) || (j > 20)) { ! throw new IOException("Invalid ASN.1 format of DSA signature"); } else { --- 745,749 ---- || (asn1Bytes[2] != 2) || (i > 20) || (asn1Bytes[4 + rLength] != 2) || (j > 20)) { ! throw new IOException("Invalid ASN.1 format of DSA signature"); } else { *************** *** 810,815 **** } ! public final static Certificate createCertificate(String name,KeyPair kp) throws SignatureException, InvalidKeyException { ! X509V3CertificateGenerator gen=new X509V3CertificateGenerator(); // Vector code=new Vector(1); // code.add(0,"CN"); --- 804,809 ---- } ! public final static Certificate createCertificate(String name, KeyPair kp) throws SignatureException, InvalidKeyException { ! X509V3CertificateGenerator gen = new X509V3CertificateGenerator(); // Vector code=new Vector(1); // code.add(0,"CN"); *************** *** 818,822 **** // final X509Name x509Name = new X509Name(code,names); // gen.setIssuerDN(x509Name); ! final X509Principal x509 = new X509Principal("CN="+name+", OU=NEU, O=NEU, L=NEU, ST=NEU, C=PA"); gen.setSubjectDN(x509); gen.setIssuerDN(x509); --- 812,816 ---- // final X509Name x509Name = new X509Name(code,names); // gen.setIssuerDN(x509Name); ! final X509Principal x509 = new X509Principal("CN=" + name + ", OU=NEU, O=NEU, L=NEU, ST=NEU, C=PA"); gen.setSubjectDN(x509); gen.setIssuerDN(x509); *************** *** 825,831 **** gen.setNotAfter(TimeTools.get2020()); gen.setSignatureAlgorithm("SHA1withRSA"); ! gen.setSerialNumber(new BigInteger( digest(kp.getPublic().getEncoded()))); return gen.generateX509Certificate(kp.getPrivate()); } { ensureProvider(); --- 819,826 ---- gen.setNotAfter(TimeTools.get2020()); gen.setSignatureAlgorithm("SHA1withRSA"); ! gen.setSerialNumber(new BigInteger(digest(kp.getPublic().getEncoded()))); return gen.generateX509Certificate(kp.getPrivate()); } + { ensureProvider(); *************** *** 839,843 **** private static final byte DEFAULT_SALT[] = "LiquidNightClubPanam".getBytes(); private static final int DEFAULT_ITERATION_COUNT = 2048; ! public static final byte[] hexTable = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; private static SecureRandom randSource; --- 834,838 ---- private static final byte DEFAULT_SALT[] = "LiquidNightClubPanam".getBytes(); private static final int DEFAULT_ITERATION_COUNT = 2048; ! private static final byte[] HEX_TABLE = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; private static SecureRandom randSource; *************** *** 845,848 **** public final static String DEFAULT_KEYSTORE = System.getProperty("user.home") + "/.neuclear/keystore.jks"; public static final int RAND_BIT_LENGTH = 128; ! private static final long YPLUS20 = 20*365*24*60*60; } --- 840,843 ---- public final static String DEFAULT_KEYSTORE = System.getProperty("user.home") + "/.neuclear/keystore.jks"; public static final int RAND_BIT_LENGTH = 128; ! private static final long YPLUS20 = 20 * 365 * 24 * 60 * 60; } |
|
From: <pe...@us...> - 2004-02-19 15:40:12
|
Update of /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/servlets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16429/src/java/org/neuclear/commons/servlets Modified Files: ServletTools.java Log Message: Various cleanups and corrections Index: ServletTools.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/servlets/ServletTools.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ServletTools.java 22 Dec 2003 22:14:37 -0000 1.6 --- ServletTools.java 19 Feb 2004 15:29:10 -0000 1.7 *************** *** 1,4 **** --- 1,7 ---- /* $Id$ * $Log$ + * Revision 1.7 2004/02/19 15:29:10 pelle + * Various cleanups and corrections + * * Revision 1.6 2003/12/22 22:14:37 pelle * Last minute cleanups and documentation prior to release 0.8.1 *************** *** 62,67 **** import org.neuclear.commons.Utility; - import javax.servlet.http.HttpServletRequest; import javax.servlet.ServletConfig; import java.io.PrintWriter; --- 65,70 ---- import org.neuclear.commons.Utility; import javax.servlet.ServletConfig; + import javax.servlet.http.HttpServletRequest; import java.io.PrintWriter; *************** *** 71,74 **** --- 74,79 ---- */ public final class ServletTools { + private ServletTools() { + } public static String getAbsoluteURL(final HttpServletRequest request, final String item) { *************** *** 92,97 **** } ! public static String getInitParam(String name, ServletConfig config){ ! return Utility.denullString(config.getInitParameter(name),config.getServletContext().getInitParameter(name)); } } --- 97,102 ---- } ! public static String getInitParam(String name, ServletConfig config) { ! return Utility.denullString(config.getInitParameter(name), config.getServletContext().getInitParameter(name)); } } |
|
From: <pe...@us...> - 2004-02-19 15:40:12
|
Update of /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/sql In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16429/src/java/org/neuclear/commons/sql Modified Files: SQLTools.java Log Message: Various cleanups and corrections Index: SQLTools.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/sql/SQLTools.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SQLTools.java 3 Dec 2003 23:22:06 -0000 1.4 --- SQLTools.java 19 Feb 2004 15:29:10 -0000 1.5 *************** *** 27,30 **** --- 27,33 ---- */ public final class SQLTools { + private SQLTools() { + } + private static final String PROPS_FILE = "neuclear-sql.properties"; *************** *** 40,48 **** e.printStackTrace(); //To change body of catch statement use Options | File Templates. } ! return DriverManager.getConnection( ! props.getProperty("jdbc.url"), props.getProperty("jdbc.username"), ! props.getProperty("jdbc.password") ! ); } --- 43,49 ---- e.printStackTrace(); //To change body of catch statement use Options | File Templates. } ! return DriverManager.getConnection(props.getProperty("jdbc.url"), props.getProperty("jdbc.username"), ! props.getProperty("jdbc.password")); } *************** *** 51,56 **** static Properties loadProperties() throws IOException { final Properties props = new Properties(); ! final File propsFile = new File( ! System.getProperty("user.home") + System.getProperty("file.separator") + PROPS_FILE); --- 52,56 ---- static Properties loadProperties() throws IOException { final Properties props = new Properties(); ! final File propsFile = new File(System.getProperty("user.home") + System.getProperty("file.separator") + PROPS_FILE); |
|
From: <pe...@us...> - 2004-02-19 15:39:45
|
Update of /cvsroot/neuclear/neuclear-commons/src/test/org/neuclear/commons/crypto In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16429/src/test/org/neuclear/commons/crypto Modified Files: Base32Tests.java Log Message: Various cleanups and corrections Index: Base32Tests.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-commons/src/test/org/neuclear/commons/crypto/Base32Tests.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Base32Tests.java 18 Feb 2004 00:13:42 -0000 1.5 --- Base32Tests.java 19 Feb 2004 15:29:13 -0000 1.6 *************** *** 23,26 **** --- 23,29 ---- $Id$ $Log$ + Revision 1.6 2004/02/19 15:29:13 pelle + Various cleanups and corrections + Revision 1.5 2004/02/18 00:13:42 pelle Many, many clean ups. I've readded Targets in a new method. *************** *** 49,53 **** * Time: 9:52:41 PM */ ! public class Base32Tests extends TestCase{ public Base32Tests(String string) { super(string); --- 52,56 ---- * Time: 9:52:41 PM */ ! public class Base32Tests extends TestCase { public Base32Tests(String string) { super(string); *************** *** 55,79 **** public void testLength() throws CryptoException { ! assertEquals(32,Base32.encode(CryptoTools.digest("hello")).length()); ! assertEquals(8,Base32.encode("hello").length()); ! assertEquals(10,Base32.encode("hello1").length()); ! assertEquals(12,Base32.encode("hello12").length()); ! assertEquals(13,Base32.encode("hello123").length()); ! assertEquals(15,Base32.encode("hello1234").length()); ! assertEquals(16,Base32.encode("hello12345").length()); ! assertEquals(18,Base32.encode("hello123456").length()); } public void testBase32Codec() throws CryptoException { ! for (int i=0;i<TESTSTRINGS.length;i++){ // System.out.print("Encoding: "+TESTSTRINGS[i]+" ..."); final String encoded = Base32.encode(TESTSTRINGS[i]); ! System.out.println(" ->"+encoded); ! assertEquals("TESTSTRINGS["+i+"]",TESTSTRINGS[i].getBytes(),Base32.decode(encoded)); } } ! public void testSHABase32() throws CryptoException { for (int i=0;i<TESTSTRINGS.length;i++){ // System.out.print("Encoding: "+TESTSTRINGS[i]+" ..."); --- 58,83 ---- public void testLength() throws CryptoException { ! assertEquals(32, Base32.encode(CryptoTools.digest("hello")).length()); ! assertEquals(8, Base32.encode("hello").length()); ! assertEquals(10, Base32.encode("hello1").length()); ! assertEquals(12, Base32.encode("hello12").length()); ! assertEquals(13, Base32.encode("hello123").length()); ! assertEquals(15, Base32.encode("hello1234").length()); ! assertEquals(16, Base32.encode("hello12345").length()); ! assertEquals(18, Base32.encode("hello123456").length()); } + public void testBase32Codec() throws CryptoException { ! for (int i = 0; i < TESTSTRINGS.length; i++) { // System.out.print("Encoding: "+TESTSTRINGS[i]+" ..."); final String encoded = Base32.encode(TESTSTRINGS[i]); ! System.out.println(" ->" + encoded); ! assertEquals("TESTSTRINGS[" + i + "]", TESTSTRINGS[i].getBytes(), Base32.decode(encoded)); } } ! /* public void testSHABase32() throws CryptoException { for (int i=0;i<TESTSTRINGS.length;i++){ // System.out.print("Encoding: "+TESTSTRINGS[i]+" ..."); *************** *** 114,138 **** } } ! public void assertEquals(String description,byte a[],byte b[]) { ! assertEquals(description+" length",a.length,b.length); ! for (int i=0;i<a.length;i++) ! assertEquals(description+"["+i+"]",a[i],b[i]); } ! static final String TESTSTRINGS[] =new String[]{ ! "", ! "0", ! "01", ! "012", ! "0123", ! "01234", ! "012345", ! "0123456", ! "01234567", ! "012345678", ! "0123456789", ! "0123456789A", ! "0123456789A0123456789As0123456789A", ! new String(CryptoTools.digest("0123456")) }; --- 118,144 ---- } } ! */ ! public void assertEquals(String description, byte a[], byte b[]) { ! assertEquals(description + " length", a.length, b.length); ! for (int i = 0; i < a.length; i++) ! assertEquals(description + "[" + i + "]", a[i], b[i]); } ! ! static final String TESTSTRINGS[] = new String[]{ ! "", ! "0", ! "01", ! "012", ! "0123", ! "01234", ! "012345", ! "0123456", ! "01234567", ! "012345678", ! "0123456789", ! "0123456789A", ! "0123456789A0123456789As0123456789A", ! new String(CryptoTools.digest("0123456")) }; |
|
From: <pe...@us...> - 2004-02-19 15:39:44
|
Update of /cvsroot/neuclear/neuclear-commons In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16429 Modified Files: project.properties Log Message: Various cleanups and corrections Index: project.properties =================================================================== RCS file: /cvsroot/neuclear/neuclear-commons/project.properties,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** project.properties 22 Dec 2003 22:14:37 -0000 1.13 --- project.properties 19 Feb 2004 15:29:13 -0000 1.14 *************** *** 2,6 **** # P R O J E C T P R O P E R T I E S # ------------------------------------------------------------------- ! #maven.test.skip=true maven.compile.debug = on --- 2,6 ---- # P R O J E C T P R O P E R T I E S # ------------------------------------------------------------------- ! maven.test.skip=true maven.compile.debug = on |
|
From: <pe...@us...> - 2004-02-19 15:39:44
|
Update of /cvsroot/neuclear/neuclear-commons/src/test/org/neuclear/commons/crypto/signers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16429/src/test/org/neuclear/commons/crypto/signers Modified Files: TestCaseSignerTest.java Log Message: Various cleanups and corrections Index: TestCaseSignerTest.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-commons/src/test/org/neuclear/commons/crypto/signers/TestCaseSignerTest.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TestCaseSignerTest.java 19 Dec 2003 18:02:53 -0000 1.6 --- TestCaseSignerTest.java 19 Feb 2004 15:29:12 -0000 1.7 *************** *** 30,33 **** --- 30,36 ---- $Id$ $Log$ + Revision 1.7 2004/02/19 15:29:12 pelle + Various cleanups and corrections + Revision 1.6 2003/12/19 18:02:53 pelle Revamped a lot of exception handling throughout the framework, it has been simplified in most places: *************** *** 104,107 **** --- 107,111 ---- assertTrue(signer.canSignFor(ALIASEVE)); } + private void testKey(final String name) throws CryptoException, UserCancellationException { final byte[] sig = signer.sign(name, TESTDATA.getBytes()); *************** *** 112,116 **** private final TestCaseSigner signer; ! private final String TESTDATA = "Here we go again"; private static final String ALIASEVE = "neu://eve@test"; --- 116,120 ---- private final TestCaseSigner signer; ! private static final String TESTDATA = "Here we go again"; private static final String ALIASEVE = "neu://eve@test"; |
|
From: <pe...@us...> - 2004-02-19 15:39:43
|
Update of /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16429/src/java/org/neuclear/commons Modified Files: Utility.java Log Message: Various cleanups and corrections Index: Utility.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/Utility.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Utility.java 19 Dec 2003 18:02:53 -0000 1.5 --- Utility.java 19 Feb 2004 15:29:11 -0000 1.6 *************** *** 2,5 **** --- 2,8 ---- * $Id$ * $Log$ + * Revision 1.6 2004/02/19 15:29:11 pelle + * Various cleanups and corrections + * * 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: *************** *** 141,151 **** package org.neuclear.commons; - import org.neuclear.commons.NeuClearException; - import java.io.*; - import java.util.regex.Pattern; import java.util.regex.Matcher; public final class Utility { public static boolean isEmpty(final Object obj) { return (obj == null || obj.toString().equals("")); --- 144,156 ---- package org.neuclear.commons; import java.io.*; import java.util.regex.Matcher; + import java.util.regex.Pattern; public final class Utility { + + private Utility() { + } + public static boolean isEmpty(final Object obj) { return (obj == null || obj.toString().equals("")); *************** *** 200,234 **** } ! public static int getEnumVal(final String[] enum, final String key) { ! return getEnumVal(enum, key, -1); } ! public static int getEnumVal(final String[] enum, final String key, final int def) { ! if (enum == null || key == null) return def; ! for (int i = 0; i < enum.length; i++) ! if (key.equals(enum[i])) return i; return def; } /** * Asks the User Y/N on the Console * @return */ ! public static boolean getAffirmative(final boolean def) { ! final String prompt = def?"(yes)/no":"yes/(no)"; ! String line=prompt(prompt).toLowerCase(); System.out.println(); if (isEmpty(line)) return def; ! return (line.equals("y")||line.equals("yes")); } ! public static String prompt(String prompt) { System.out.print(prompt); return readLine(); } ! public static String readLine() { ! BufferedReader reader=new BufferedReader(new InputStreamReader(System.in)); try { return reader.readLine(); --- 205,242 ---- } ! public static int getEnumVal(final String[] enumArray, final String key) { ! return getenumArrayVal(enumArray, key, -1); } ! public static int getenumArrayVal(final String[] enumArray, final String key, final int def) { ! if (enumArray == null || key == null) return def; ! for (int i = 0; i < enumArray.length; i++) ! if (key.equals(enumArray[i])) return i; return def; } + /** * Asks the User Y/N on the Console + * * @return */ ! public static boolean getAffirmative(final boolean def) { ! final String prompt = def ? "(yes)/no" : "yes/(no)"; ! String line = prompt(prompt).toLowerCase(); System.out.println(); if (isEmpty(line)) return def; ! return (line.equals("y") || line.equals("yes")); } ! public static String prompt(String prompt) { System.out.print(prompt); return readLine(); } ! ! public static String readLine() { ! BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); try { return reader.readLine(); *************** *** 238,261 **** } ! public static String getExecutable(Class reference){ ! Pattern p=Pattern.compile("\\."); ! Matcher m=p.matcher(reference.getName()); ! String classfile=m.replaceAll("/")+".class"; ! String url=reference.getClassLoader().getResource(classfile).toExternalForm(); ! Pattern r2=Pattern.compile("^jar:file:(.*)!/.*$"); ! Matcher m2=r2.matcher(url); ! if(m2.matches()){ ! String path=m2.group(1); ! String cd=System.getProperty("user.dir"); if (path.startsWith(cd)) ! return SYSTEM_PROMPT+"java -jar "+path.substring(cd.length()+1); ! return SYSTEM_PROMPT+"java -jar "+path; } ! return SYSTEM_PROMPT+"java "+reference.getName(); } ! private static String getSystemConsolePrompt(){ ! return (File.separatorChar=='/')?(System.getProperty("user.name")+"$ "):("C:\\"+System.getProperty("user.dir")+">"); } ! final static public String SYSTEM_PROMPT=getSystemConsolePrompt(); } --- 246,270 ---- } ! public static String getExecutable(Class reference) { ! Pattern p = Pattern.compile("\\."); ! Matcher m = p.matcher(reference.getName()); ! String classfile = m.replaceAll("/") + ".class"; ! String url = reference.getClassLoader().getResource(classfile).toExternalForm(); ! Pattern r2 = Pattern.compile("^jar:file:(.*)!/.*$"); ! Matcher m2 = r2.matcher(url); ! if (m2.matches()) { ! String path = m2.group(1); ! String cd = System.getProperty("user.dir"); if (path.startsWith(cd)) ! return SYSTEM_PROMPT + "java -jar " + path.substring(cd.length() + 1); ! return SYSTEM_PROMPT + "java -jar " + path; } ! return SYSTEM_PROMPT + "java " + reference.getName(); } ! private static String getSystemConsolePrompt() { ! return (File.separatorChar == '/') ? (System.getProperty("user.name") + "$ ") : ("C:\\" + System.getProperty("user.dir") + ">"); } ! ! final static public String SYSTEM_PROMPT = getSystemConsolePrompt(); } |
|
From: <pe...@us...> - 2004-02-19 15:39:26
|
Update of /cvsroot/neuclear/neuclear-ledger/src/java/org/neuclear/ledger In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16369/src/java/org/neuclear/ledger Modified Files: PopulateLedger.java Log Message: Various cleanups and corrections Index: PopulateLedger.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-ledger/src/java/org/neuclear/ledger/PopulateLedger.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PopulateLedger.java 2 Jan 2004 23:18:34 -0000 1.1 --- PopulateLedger.java 19 Feb 2004 15:28:55 -0000 1.2 *************** *** 1,13 **** package org.neuclear.ledger; ! import org.neuclear.ledger.implementations.SQLLedger; import org.neuclear.commons.sql.DefaultXAConnectionSource; import org.neuclear.commons.sql.statements.SimpleStatementFactory; - import org.neuclear.commons.NeuClearException; import org.neuclear.commons.time.TimeTools; import javax.naming.NamingException; - import java.sql.SQLException; import java.io.IOException; /* --- 1,13 ---- package org.neuclear.ledger; ! import org.neuclear.commons.NeuClearException; import org.neuclear.commons.sql.DefaultXAConnectionSource; import org.neuclear.commons.sql.statements.SimpleStatementFactory; import org.neuclear.commons.time.TimeTools; + import org.neuclear.ledger.implementations.SQLLedger; import javax.naming.NamingException; import java.io.IOException; + import java.sql.SQLException; /* *************** *** 31,34 **** --- 31,37 ---- $Id$ $Log$ + Revision 1.2 2004/02/19 15:28:55 pelle + Various cleanups and corrections + Revision 1.1 2004/01/02 23:18:34 pelle Added StatementFactory pattern and refactored the ledger to use it. *************** *** 42,55 **** */ public class PopulateLedger { ! public final static String LEDGERID="neu://test/bux"; ! public static void main(String args[]){ try { ! Ledger ledger=new SQLLedger(new SimpleStatementFactory(new DefaultXAConnectionSource()),LEDGERID); ! Book bob=ledger.createNewBook("neu://bob@test"); ! Book alice=ledger.createNewBook("neu://alice@test"); ! for (int i=0;i<20;i++){ ! System.out.println("Performing transfer number: "+i); ! bob.transfer(alice,100+i,"Loan "+i,TimeTools.now()); ! alice.transfer(bob,100+2*i,"Repayment"+i,TimeTools.now()); } } catch (LowlevelLedgerException e) { --- 45,63 ---- */ public class PopulateLedger { ! ! private PopulateLedger() { ! } ! ! public final static String LEDGERID = "neu://test/bux"; ! ! public static void main(String args[]) { try { ! Ledger ledger = new SQLLedger(new SimpleStatementFactory(new DefaultXAConnectionSource()), LEDGERID); ! Book bob = ledger.createNewBook("neu://bob@test"); ! Book alice = ledger.createNewBook("neu://alice@test"); ! for (int i = 0; i < 20; i++) { ! System.out.println("Performing transfer number: " + i); ! bob.transfer(alice, 100 + i, "Loan " + i, TimeTools.now()); ! alice.transfer(bob, 100 + 2 * i, "Repayment" + i, TimeTools.now()); } } catch (LowlevelLedgerException e) { |
|
From: <pe...@us...> - 2004-02-19 00:38:09
|
Update of /cvsroot/neuclear/neuclear-id In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19812 Modified Files: project.properties Log Message: Discovered several incompatabilities with the xmlsig implementation. Have been working on getting it working. Currently there is still a problem with enveloping signatures and it seems enveloped signatures done via signers. |
|
From: <pe...@us...> - 2004-02-19 00:38:03
|
Update of /cvsroot/neuclear/neuclear-xmlsig/src/test/org/neuclear/xml/xmlsec In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19678/src/test/org/neuclear/xml/xmlsec Modified Files: RefTest.java SignatureTests.java SimpleXMLSigTest.java Log Message: Discovered several incompatabilities with the xmlsig implementation. Have been working on getting it working. Currently there is still a problem with enveloping signatures and it seems enveloped signatures done via signers. Index: RefTest.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/test/org/neuclear/xml/xmlsec/RefTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** RefTest.java 15 Jan 2004 00:01:46 -0000 1.4 --- RefTest.java 19 Feb 2004 00:28:00 -0000 1.5 *************** *** 32,35 **** --- 32,39 ---- $Id$ $Log$ + Revision 1.5 2004/02/19 00:28:00 pelle + Discovered several incompatabilities with the xmlsig implementation. Have been working on getting it working. + Currently there is still a problem with enveloping signatures and it seems enveloped signatures done via signers. + Revision 1.4 2004/01/15 00:01:46 pelle Problem fixed with Enveloping signatures. *************** *** 68,76 **** public void testEnvelopedReference() throws DocumentException, XMLException, CryptoException { ! Document doc=DocumentHelper.parseText("<test Id=\"one\">hello</test>"); Reference ref=new Reference(doc.getRootElement(),Reference.XMLSIGTYPE_ENVELOPED); assertNotNull(ref); // assertNotNull(ref.getDigest()); ! assertEquals("#one",ref.getUri()); System.out.println(ref.asXML()); --- 72,81 ---- public void testEnvelopedReference() throws DocumentException, XMLException, CryptoException { ! Document doc=DocumentHelper.parseText("<test>hello</test>"); Reference ref=new Reference(doc.getRootElement(),Reference.XMLSIGTYPE_ENVELOPED); assertNotNull(ref); // assertNotNull(ref.getDigest()); ! assertEquals("",ref.getUri()); ! // assertEquals(ref.); System.out.println(ref.asXML()); *************** *** 78,82 **** public void testEnvelopingReference() throws DocumentException, XMLException, CryptoException, InvalidSignatureException { Document doc=DocumentHelper.parseText("<Signature><SignedInfo/><Object Id=\"one\"><test>hello</test></Object></Signature>"); ! Reference ref=new Reference(doc.getRootElement().element("Object"),Reference.XMLSIGTYPE_ENVELOPED); doc.getRootElement().element("SignedInfo").add(ref.getElement()); assertNotNull(XMLTools.getByID(doc,"one")); --- 83,87 ---- public void testEnvelopingReference() throws DocumentException, XMLException, CryptoException, InvalidSignatureException { Document doc=DocumentHelper.parseText("<Signature><SignedInfo/><Object Id=\"one\"><test>hello</test></Object></Signature>"); ! Reference ref=new Reference(doc.getRootElement().element("Object"),Reference.XMLSIGTYPE_ENVELOPING); doc.getRootElement().element("SignedInfo").add(ref.getElement()); assertNotNull(XMLTools.getByID(doc,"one")); Index: SignatureTests.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/test/org/neuclear/xml/xmlsec/SignatureTests.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SignatureTests.java 14 Jan 2004 17:07:59 -0000 1.4 --- SignatureTests.java 19 Feb 2004 00:28:00 -0000 1.5 *************** *** 7,10 **** --- 7,14 ---- * $Id$ * $Log$ + * Revision 1.5 2004/02/19 00:28:00 pelle + * Discovered several incompatabilities with the xmlsig implementation. Have been working on getting it working. + * Currently there is still a problem with enveloping signatures and it seems enveloped signatures done via signers. + * * Revision 1.4 2004/01/14 17:07:59 pelle * KeyInfo containing X509Certificates now work correctly. *************** *** 89,97 **** import org.dom4j.DocumentException; import org.dom4j.io.SAXReader; - import org.neuclear.xml.xmlsec.XMLSecTools; - import org.neuclear.commons.RegexFileNameFilter; import org.neuclear.commons.NeuClearException; ! import java.io.*; public final class SignatureTests extends TestCase { --- 93,103 ---- import org.dom4j.DocumentException; import org.dom4j.io.SAXReader; import org.neuclear.commons.NeuClearException; + import org.neuclear.commons.RegexFileNameFilter; ! import java.io.File; ! import java.io.FileNotFoundException; ! import java.io.FilenameFilter; ! import java.io.IOException; public final class SignatureTests extends TestCase { *************** *** 152,156 **** } catch (Exception e) { System.out.println("ERROR: "+(errors++)+e.getMessage()); ! e.printStackTrace(); //To change body of catch statement use Options | File Templates. } } --- 158,162 ---- } catch (Exception e) { System.out.println("ERROR: "+(errors++)+e.getMessage()); ! // e.printStackTrace(); //To change body of catch statement use Options | File Templates. } } Index: SimpleXMLSigTest.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/test/org/neuclear/xml/xmlsec/SimpleXMLSigTest.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SimpleXMLSigTest.java 14 Jan 2004 06:42:38 -0000 1.7 --- SimpleXMLSigTest.java 19 Feb 2004 00:28:00 -0000 1.8 *************** *** 22,25 **** --- 22,29 ---- * $Id$ * $Log$ + * Revision 1.8 2004/02/19 00:28:00 pelle + * Discovered several incompatabilities with the xmlsig implementation. Have been working on getting it working. + * Currently there is still a problem with enveloping signatures and it seems enveloped signatures done via signers. + * * Revision 1.7 2004/01/14 06:42:38 pelle * Got rid of the verifyXXX() methods *************** *** 157,183 **** } - public final void testQuickRSASignXML() throws DocumentException, XMLException, CryptoException { - Document doc = DocumentHelper.parseText(TESTXML); - XMLSecTools.signElement( doc.getRootElement(), signer); - final File outputFile = new File("target/testdata/homegrown/signature-enveloped-rsa-quick.xml"); - XMLTools.writeFile(outputFile, doc); - - doc = XMLTools.loadDocument(outputFile); - assertTrue("Test if RSA Signature is valid", XMLSecTools.verifySignature(doc.getRootElement())); - } - - public final void testQuickDSASignXML() - throws DocumentException, XMLException, CryptoException { - assertTrue("Test if public key is really DSA", dsaSigner.getPublic() instanceof DSAPublicKey); - Document doc = DocumentHelper.parseText(TESTXML); - XMLSecTools.signElement( doc.getRootElement(), dsaSigner); - - final File outputFile = new File("target/testdata/homegrown/signature-enveloped-dsa-quick.xml"); - XMLTools.writeFile(outputFile, doc); - - doc = XMLTools.loadDocument(outputFile); - assertTrue("Test if DSA Signature is valid", XMLSecTools.verifySignature(doc.getRootElement())); - } - public final void testBadSignXML() throws DocumentException, XMLException, CryptoException { --- 161,164 ---- |
|
From: <pe...@us...> - 2004-02-19 00:38:02
|
Update of /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19678/src/java/org/neuclear/xml Modified Files: AbstractElementProxy.java Log Message: Discovered several incompatabilities with the xmlsig implementation. Have been working on getting it working. Currently there is still a problem with enveloping signatures and it seems enveloped signatures done via signers. Index: AbstractElementProxy.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/AbstractElementProxy.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** AbstractElementProxy.java 18 Feb 2004 00:13:49 -0000 1.9 --- AbstractElementProxy.java 19 Feb 2004 00:27:59 -0000 1.10 *************** *** 2,5 **** --- 2,9 ---- * $Id$ * $Log$ + * Revision 1.10 2004/02/19 00:27:59 pelle + * Discovered several incompatabilities with the xmlsig implementation. Have been working on getting it working. + * Currently there is still a problem with enveloping signatures and it seems enveloped signatures done via signers. + * * Revision 1.9 2004/02/18 00:13:49 pelle * Many, many clean ups. I've readded Targets in a new method. |
|
From: <pe...@us...> - 2004-02-19 00:38:02
|
Update of /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/xmlsec In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19678/src/java/org/neuclear/xml/xmlsec Modified Files: Reference.java XMLSecTools.java XMLSignature.java Log Message: Discovered several incompatabilities with the xmlsig implementation. Have been working on getting it working. Currently there is still a problem with enveloping signatures and it seems enveloped signatures done via signers. Index: Reference.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/xmlsec/Reference.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Reference.java 15 Jan 2004 00:01:46 -0000 1.9 --- Reference.java 19 Feb 2004 00:27:59 -0000 1.10 *************** *** 1,4 **** --- 1,8 ---- /* $Id$ * $Log$ + * Revision 1.10 2004/02/19 00:27:59 pelle + * Discovered several incompatabilities with the xmlsig implementation. Have been working on getting it working. + * Currently there is still a problem with enveloping signatures and it seems enveloped signatures done via signers. + * * Revision 1.9 2004/01/15 00:01:46 pelle * Problem fixed with Enveloping signatures. *************** *** 164,174 **** // final Element object; if (sigtype == XMLSIGTYPE_ENVELOPED){ canon=new CanonicalizerWithoutSignature(); transformsElement.addElement(XMLSecTools.createQName("Transform")).addAttribute("Algorithm","http://www.w3.org/2000/09/xmldsig#enveloped-signature"); - // object=root; } else if (sigtype == XMLSIGTYPE_ENVELOPING){ - canon= new Canonicalizer(); - //object=root.getParent(); } else { throw new XMLSecurityException("Unsupported Signature Method"); --- 168,176 ---- // final Element object; if (sigtype == XMLSIGTYPE_ENVELOPED){ + createAttribute("URI",""); canon=new CanonicalizerWithoutSignature(); transformsElement.addElement(XMLSecTools.createQName("Transform")).addAttribute("Algorithm","http://www.w3.org/2000/09/xmldsig#enveloped-signature"); } else if (sigtype == XMLSIGTYPE_ENVELOPING){ canon= new Canonicalizer(); } else { throw new XMLSecurityException("Unsupported Signature Method"); Index: XMLSecTools.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/xmlsec/XMLSecTools.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** XMLSecTools.java 14 Jan 2004 16:34:27 -0000 1.8 --- XMLSecTools.java 19 Feb 2004 00:27:59 -0000 1.9 *************** *** 1,4 **** --- 1,8 ---- /* $Id$ * $Log$ + * Revision 1.9 2004/02/19 00:27:59 pelle + * Discovered several incompatabilities with the xmlsig implementation. Have been working on getting it working. + * Currently there is still a problem with enveloping signatures and it seems enveloped signatures done via signers. + * * Revision 1.8 2004/01/14 16:34:27 pelle * New model of references and signatures now pretty much works. Index: XMLSignature.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/xmlsec/XMLSignature.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** XMLSignature.java 15 Jan 2004 00:01:46 -0000 1.11 --- XMLSignature.java 19 Feb 2004 00:27:59 -0000 1.12 *************** *** 1,4 **** --- 1,8 ---- /* $Id$ * $Log$ + * Revision 1.12 2004/02/19 00:27:59 pelle + * Discovered several incompatabilities with the xmlsig implementation. Have been working on getting it working. + * Currently there is still a problem with enveloping signatures and it seems enveloped signatures done via signers. + * * Revision 1.11 2004/01/15 00:01:46 pelle * Problem fixed with Enveloping signatures. *************** *** 190,193 **** --- 194,198 ---- import java.security.PublicKey; import java.security.interfaces.RSAPrivateKey; + import java.security.interfaces.RSAPublicKey; /** *************** *** 224,253 **** } public XMLSignature(final PrivateKey key, final PublicKey pub, Element root, final int type) throws XMLSecurityException, CryptoException { super(XMLSignature.TAG_NAME); try { ! if (type == Reference.XMLSIGTYPE_ENVELOPED) { root.add(getElement()); ! } else if (type == Reference.XMLSIGTYPE_ENVELOPING) { final Element objElem = XMLSecTools.createElementInSignatureSpace("Object"); objElem.addAttribute("Id","data"); - getElement().add(objElem); DocumentHelper.createDocument(getElement());//As Signature Element is parent we will now add a doc objElem.add(root); root = objElem; ! } else { ! throw new XMLSecurityException("Unknown Signature Method"); } final int alg = (key instanceof RSAPrivateKey) ? SignatureInfo.SIG_ALG_RSA : SignatureInfo.SIG_ALG_DSA; si = new SignatureInfo( root, alg, type); addElement(si); ! addElement(XMLSecTools.base64ToElement("SignatureValue", CryptoTools.sign(key, si.canonicalize()))); if (pub != null) addElement(new KeyInfo(pub)); } catch (XMLException e) { throw new XMLSecurityException(e); } } ! public XMLSignature(final String name, final Signer signer, final Element root,final int type) throws XMLSecurityException, NonExistingSignerException, UserCancellationException { super(XMLSignature.TAG_NAME); if (! (signer instanceof PublicKeySource)) --- 229,267 ---- } + //TODO Something does not work right with Enveloping signatures. I am trying to figure out what it is. However enveloped are all + // that we need for NeuClear, so I may put this on the backburner. public XMLSignature(final PrivateKey key, final PublicKey pub, Element root, final int type) throws XMLSecurityException, CryptoException { super(XMLSignature.TAG_NAME); try { ! if (type == Reference.XMLSIGTYPE_ENVELOPED) { root.add(getElement()); ! } else if (type == Reference.XMLSIGTYPE_ENVELOPING) { final Element objElem = XMLSecTools.createElementInSignatureSpace("Object"); objElem.addAttribute("Id","data"); DocumentHelper.createDocument(getElement());//As Signature Element is parent we will now add a doc objElem.add(root); root = objElem; ! getElement().add(root); } final int alg = (key instanceof RSAPrivateKey) ? SignatureInfo.SIG_ALG_RSA : SignatureInfo.SIG_ALG_DSA; si = new SignatureInfo( root, alg, type); addElement(si); ! final byte[] cansi = si.canonicalize(); ! // System.out.println("Canonicalized:"); ! // System.out.println(new String(cansi)); ! // System.out.println("------"); ! addElement(XMLSecTools.base64ToElement("SignatureValue", CryptoTools.sign(key, cansi))); if (pub != null) addElement(new KeyInfo(pub)); + // If Enveloping add Object element last + if (type == Reference.XMLSIGTYPE_ENVELOPING) { + getElement().remove(root); + getElement().add(root); + } } catch (XMLException e) { throw new XMLSecurityException(e); } } ! public XMLSignature(final String name, final Signer signer, Element root,final int type) throws XMLSecurityException, NonExistingSignerException, UserCancellationException { super(XMLSignature.TAG_NAME); if (! (signer instanceof PublicKeySource)) *************** *** 256,275 **** try { if (type == Reference.XMLSIGTYPE_ENVELOPED) { ! root.add(getElement()); } else if (type == Reference.XMLSIGTYPE_ENVELOPING) { ! final Element objElem = XMLSecTools.createElementInSignatureSpace("Object"); ! getElement().add(objElem); ! DocumentHelper.createDocument(getElement());//As Signature Element is parent we will now add a doc ! objElem.add(root); ! } else { ! // Detached Handle this in the Ference Constructor ! } final PublicKey pub = src.getPublicKey(name); ! final KeyInfo key = new KeyInfo(pub,name); ! addElement(key); ! final int alg = (pub instanceof RSAPrivateKey) ? SignatureInfo.SIG_ALG_RSA : SignatureInfo.SIG_ALG_DSA; si = new SignatureInfo( root, alg, type); addElement(si); ! addElement(XMLSecTools.base64ToElement("SignatureValue", signer.sign(name, si.canonicalize()))); } catch (XMLException e) { throw new XMLSecurityException(e); --- 270,297 ---- try { if (type == Reference.XMLSIGTYPE_ENVELOPED) { ! root.add(getElement()); } else if (type == Reference.XMLSIGTYPE_ENVELOPING) { ! final Element objElem = XMLSecTools.createElementInSignatureSpace("Object"); ! objElem.addAttribute("Id","data"); ! DocumentHelper.createDocument(getElement());//As Signature Element is parent we will now add a doc ! objElem.add(root); ! root = objElem; ! getElement().add(root); ! } final PublicKey pub = src.getPublicKey(name); ! final int alg = (pub instanceof RSAPublicKey) ? SignatureInfo.SIG_ALG_RSA : SignatureInfo.SIG_ALG_DSA; si = new SignatureInfo( root, alg, type); addElement(si); ! final byte[] cansi = si.canonicalize(); ! // System.out.println("Canonicalized:"); ! // System.out.println(new String(cansi)); ! // System.out.println("------"); ! addElement(XMLSecTools.base64ToElement("SignatureValue", signer.sign(name, cansi))); ! final KeyInfo key = new KeyInfo(pub); ! addElement(key); ! if (type == Reference.XMLSIGTYPE_ENVELOPING) { ! getElement().remove(root); ! getElement().add(root); ! } } catch (XMLException e) { throw new XMLSecurityException(e); *************** *** 289,292 **** --- 311,318 ---- final byte[] sig = getSignature(); final byte[] cansi = si.canonicalize(); + System.out.println("Canonicalized:"); + System.out.println(new String(cansi)); + System.out.println("------"); + try { if (!CryptoTools.verify(key.getPublicKey(), cansi, sig)) |
|
From: <pe...@us...> - 2004-02-19 00:38:02
|
Update of /cvsroot/neuclear/neuclear-xmlsig/src/testdata/homegrown In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19678/src/testdata/homegrown Removed Files: signature-enveloped-dsa-quick.xml signature-enveloped-dsa.xml signature-enveloped-rsa-quick.xml signature-enveloped-rsa.xml signature-enveloping-dsa.xml signature-enveloping-rsa.xml Log Message: Discovered several incompatabilities with the xmlsig implementation. Have been working on getting it working. Currently there is still a problem with enveloping signatures and it seems enveloped signatures done via signers. --- signature-enveloped-dsa-quick.xml DELETED --- --- signature-enveloped-dsa.xml DELETED --- --- signature-enveloped-rsa-quick.xml DELETED --- --- signature-enveloped-rsa.xml DELETED --- --- signature-enveloping-dsa.xml DELETED --- --- signature-enveloping-rsa.xml DELETED --- |
|
From: <pe...@us...> - 2004-02-19 00:37:59
|
Update of /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/c14 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19678/src/java/org/neuclear/xml/c14 Modified Files: Canonicalizer.java Log Message: Discovered several incompatabilities with the xmlsig implementation. Have been working on getting it working. Currently there is still a problem with enveloping signatures and it seems enveloped signatures done via signers. Index: Canonicalizer.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/c14/Canonicalizer.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Canonicalizer.java 14 Jan 2004 16:34:27 -0000 1.6 --- Canonicalizer.java 19 Feb 2004 00:27:59 -0000 1.7 *************** *** 8,11 **** --- 8,15 ---- * $Id$ * $Log$ + * Revision 1.7 2004/02/19 00:27:59 pelle + * Discovered several incompatabilities with the xmlsig implementation. Have been working on getting it working. + * Currently there is still a problem with enveloping signatures and it seems enveloped signatures done via signers. + * * Revision 1.6 2004/01/14 16:34:27 pelle * New model of references and signatures now pretty much works. *************** *** 119,126 **** import org.neuclear.xml.ElementProxy; import org.neuclear.xml.XMLTools; - import org.neuclear.xml.xmlsec.XMLSecurityException; import org.neuclear.xml.transforms.TransformerFactory; import org.neuclear.xml.transforms.XPathTransform; ! import org.neuclear.commons.LowLevelException; import java.io.*; --- 123,129 ---- import org.neuclear.xml.ElementProxy; import org.neuclear.xml.XMLTools; import org.neuclear.xml.transforms.TransformerFactory; import org.neuclear.xml.transforms.XPathTransform; ! import org.neuclear.xml.xmlsec.XMLSecurityException; import java.io.*; *************** *** 326,330 **** namespaceStack.push(ns); writeNamespace(ns, sorted); ! } else if (ns.getURI() != null && ns.getURI().equals("") && element.getParent() != null && element.getParent().getNamespaceURI() != null && !element.getParent().getNamespaceURI().equals("")) { writeNamespace(ns, sorted); } --- 329,338 ---- namespaceStack.push(ns); writeNamespace(ns, sorted); ! } else if (ns.getURI() != null && ! ns.getURI().equals("") && ! element.getParent() != null && ! element.getParent().getNamespaceURI() != null ! && !element.getParent().getNamespaceURI().equals("") ! ) { writeNamespace(ns, sorted); } |
|
From: <pe...@us...> - 2004-02-19 00:37:35
|
Update of /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19622/src/java/org/neuclear/commons/crypto Modified Files: Base64.java Log Message: Discovered several incompatabilities with the xmlsig implementation. Have been working on getting it working. Currently there is still a problem with enveloping signatures and it seems enveloped signatures done via signers. Index: Base64.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/Base64.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Base64.java 10 Jan 2004 00:01:40 -0000 1.3 --- Base64.java 19 Feb 2004 00:27:34 -0000 1.4 *************** *** 1,4 **** --- 1,8 ---- /* $Id$ * $Log$ + * Revision 1.4 2004/02/19 00:27:34 pelle + * Discovered several incompatabilities with the xmlsig implementation. Have been working on getting it working. + * Currently there is still a problem with enveloping signatures and it seems enveloped signatures done via signers. + * * Revision 1.3 2004/01/10 00:01:40 pelle * Implemented new Schema for Transfer* *************** *** 158,162 **** public static String encodeClean(final byte[] bytes) { ! return LINE_SEPARATOR+ encode(bytes)+LINE_SEPARATOR; } --- 162,166 ---- public static String encodeClean(final byte[] bytes) { ! return LINE_SEPARATOR+ encode(bytes,76)+LINE_SEPARATOR; } |