Update of /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/c14 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23732/src/java/org/neuclear/xml/c14 Modified Files: Canonicalizer.java CanonicalizerWithComments.java CanonicalizerWithoutSignature.java Log Message: More improvements on the XMLSignature. Now uses the Transforms properly, References properly. All the major elements have been refactored to be cleaner and more correct. Index: Canonicalizer.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/c14/Canonicalizer.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Canonicalizer.java 3 Mar 2004 23:23:24 -0000 1.12 --- Canonicalizer.java 8 Mar 2004 23:51:02 -0000 1.13 *************** *** 8,11 **** --- 8,15 ---- * $Id$ * $Log$ + * Revision 1.13 2004/03/08 23:51:02 pelle + * More improvements on the XMLSignature. Now uses the Transforms properly, References properly. + * All the major elements have been refactored to be cleaner and more correct. + * * Revision 1.12 2004/03/03 23:23:24 pelle * Interops with enveloped signatures. *************** *** 142,145 **** --- 146,150 ---- import org.dom4j.*; import org.dom4j.tree.NamespaceStack; + import org.neuclear.commons.Utility; import org.neuclear.xml.ElementProxy; import org.neuclear.xml.XMLTools; *************** *** 147,151 **** import org.neuclear.xml.transforms.XPathTransform; import org.neuclear.xml.xmlsec.XMLSecurityException; - import org.neuclear.commons.Utility; import java.io.*; --- 152,155 ---- *************** *** 166,174 **** public Canonicalizer() { ! this(XPATH_WO_COMMENTS); } ! protected Canonicalizer(final String xpath) { ! super(xpath); } --- 170,178 ---- public Canonicalizer() { ! this(ALGORITHM, XPATH_WO_COMMENTS); } ! protected Canonicalizer(final String algorithm, final String xpath) { ! super(algorithm, xpath); } Index: CanonicalizerWithComments.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/c14/CanonicalizerWithComments.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CanonicalizerWithComments.java 21 Nov 2003 04:44:30 -0000 1.3 --- CanonicalizerWithComments.java 8 Mar 2004 23:51:03 -0000 1.4 *************** *** 3,8 **** import org.neuclear.xml.transforms.TransformerFactory; - import java.io.Writer; - /** * (C) 2003 Antilles Software Ventures SA --- 3,6 ---- *************** *** 12,15 **** --- 10,17 ---- * $Id$ * $Log$ + * Revision 1.4 2004/03/08 23:51:03 pelle + * More improvements on the XMLSignature. Now uses the Transforms properly, References properly. + * All the major elements have been refactored to be cleaner and more correct. + * * Revision 1.3 2003/11/21 04:44:30 pelle * EncryptedFileStore now works. It uses the PBECipher with DES3 afair. *************** *** 17,21 **** * 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/11 21:18:07 pelle * Further vital reshuffling. --- 19,23 ---- * 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/11 21:18:07 pelle * Further vital reshuffling. *************** *** 23,31 **** * org.neuclear.signers.* as well as org.neuclear.passphraseagents have been moved under org.neuclear.commons.crypto as well. * Did a bit of work on the Canonicalizer and changed a few other minor bits. ! * * Revision 1.1.1.1 2003/11/11 16:33:20 pelle * Moved over from neudist.org * Moved remaining common utilities into commons ! * * Revision 1.1 2003/02/08 18:48:07 pelle * The Signature phase has been rewritten. --- 25,33 ---- * org.neuclear.signers.* as well as org.neuclear.passphraseagents have been moved under org.neuclear.commons.crypto as well. * Did a bit of work on the Canonicalizer and changed a few other minor bits. ! * <p/> * Revision 1.1.1.1 2003/11/11 16:33:20 pelle * Moved over from neudist.org * Moved remaining common utilities into commons ! * <p/> * Revision 1.1 2003/02/08 18:48:07 pelle * The Signature phase has been rewritten. *************** *** 38,52 **** * And CanonicalizerWithoutSignature which leaves out the Signature in the Canonicalization phase and is thus * a lot more efficient than the previous approach. - * */ ! public final class CanonicalizerWithComments extends Canonicalizer{ public CanonicalizerWithComments() { ! super(XPATH_W_COMMENTS); } public static final String XPATH_W_COMMENTS = "(//. | //@* | //namespace::*| self::processing-instruction()|self::comment())"; ! public static final String ALGORITHM="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"; { ! TransformerFactory.registerTransformer(ALGORITHM,CanonicalizerWithComments.class); } --- 40,55 ---- * And CanonicalizerWithoutSignature which leaves out the Signature in the Canonicalization phase and is thus * a lot more efficient than the previous approach. */ ! public final class CanonicalizerWithComments extends Canonicalizer { public CanonicalizerWithComments() { ! super(ALGORITHM, XPATH_W_COMMENTS); } + public static final String XPATH_W_COMMENTS = "(//. | //@* | //namespace::*| self::processing-instruction()|self::comment())"; ! public static final String ALGORITHM = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"; ! { ! TransformerFactory.registerTransformer(ALGORITHM, CanonicalizerWithComments.class); } Index: CanonicalizerWithoutSignature.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/c14/CanonicalizerWithoutSignature.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CanonicalizerWithoutSignature.java 21 Nov 2003 04:44:30 -0000 1.3 --- CanonicalizerWithoutSignature.java 8 Mar 2004 23:51:03 -0000 1.4 *************** *** 1,9 **** package org.neuclear.xml.c14; - import org.dom4j.QName; import org.neuclear.xml.transforms.TransformerFactory; - import org.neuclear.xml.xmlsec.XMLSecTools; - - import java.io.Writer; /** --- 1,5 ---- *************** *** 14,17 **** --- 10,17 ---- * $Id$ * $Log$ + * Revision 1.4 2004/03/08 23:51:03 pelle + * More improvements on the XMLSignature. Now uses the Transforms properly, References properly. + * All the major elements have been refactored to be cleaner and more correct. + * * Revision 1.3 2003/11/21 04:44:30 pelle * EncryptedFileStore now works. It uses the PBECipher with DES3 afair. *************** *** 19,23 **** * 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/11 21:18:07 pelle * Further vital reshuffling. --- 19,23 ---- * 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/11 21:18:07 pelle * Further vital reshuffling. *************** *** 25,43 **** * org.neuclear.signers.* as well as org.neuclear.passphraseagents have been moved under org.neuclear.commons.crypto as well. * Did a bit of work on the Canonicalizer and changed a few other minor bits. ! * * Revision 1.1.1.1 2003/11/11 16:33:20 pelle * Moved over from neudist.org * Moved remaining common utilities into commons ! * * Revision 1.3 2003/02/21 22:48:14 pelle * New Test Infrastructure * Added test keys in src/testdata/keys * Modified tools to handle these keys ! * * Revision 1.2 2003/02/11 14:47:03 pelle * Added benchmarking code. * DigestValue is now a required part. * If you pass a keypair when you sign, you get the PublicKey included as a KeyInfo block within the signature. ! * * Revision 1.1 2003/02/08 18:48:07 pelle * The Signature phase has been rewritten. --- 25,43 ---- * org.neuclear.signers.* as well as org.neuclear.passphraseagents have been moved under org.neuclear.commons.crypto as well. * Did a bit of work on the Canonicalizer and changed a few other minor bits. ! * <p/> * Revision 1.1.1.1 2003/11/11 16:33:20 pelle * Moved over from neudist.org * Moved remaining common utilities into commons ! * <p/> * Revision 1.3 2003/02/21 22:48:14 pelle * New Test Infrastructure * Added test keys in src/testdata/keys * Modified tools to handle these keys ! * <p/> * Revision 1.2 2003/02/11 14:47:03 pelle * Added benchmarking code. * DigestValue is now a required part. * If you pass a keypair when you sign, you get the PublicKey included as a KeyInfo block within the signature. ! * <p/> * Revision 1.1 2003/02/08 18:48:07 pelle * The Signature phase has been rewritten. *************** *** 50,65 **** * And CanonicalizerWithoutSignature which leaves out the Signature in the Canonicalization phase and is thus * a lot more efficient than the previous approach. - * */ ! public final class CanonicalizerWithoutSignature extends Canonicalizer{ public CanonicalizerWithoutSignature() { ! super(XPATH_W_COMMENTS); } public static final String XPATH_W_COMMENTS = "(//. | //@* | //namespace::*| self::processing-instruction())[not(self::ds:Signature)]"; ! public static final String ALGORITHM="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"; { ! TransformerFactory.registerTransformer(ALGORITHM,CanonicalizerWithoutSignature.class); } --- 50,66 ---- * And CanonicalizerWithoutSignature which leaves out the Signature in the Canonicalization phase and is thus * a lot more efficient than the previous approach. */ ! public final class CanonicalizerWithoutSignature extends Canonicalizer { public CanonicalizerWithoutSignature() { ! super(ALGORITHM, XPATH_W_COMMENTS); } + public static final String XPATH_W_COMMENTS = "(//. | //@* | //namespace::*| self::processing-instruction())[not(self::ds:Signature)]"; ! public static final String ALGORITHM = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"; ! { ! TransformerFactory.registerTransformer(ALGORITHM, CanonicalizerWithoutSignature.class); } |