Permalink
Browse files

Remove Bouncy Castle dependency

  • Loading branch information...
1 parent af0173e commit 0b9ba8fe67225e5923ce4c50a2652742bc69c7f5 Martin Kleppmann committed Mar 1, 2009
Showing with 12 additions and 35 deletions.
  1. +0 −12 contrib.xml
  2. +0 −1 paths/external-fp-jars
  3. +0 −1 paths/external-se-jars
  4. +0 −20 src/fc/test/junit/XmlData.java
  5. +12 −1 src/fc/xml/diff/Diff.java
View
@@ -82,18 +82,6 @@ checking its hash, and then unpacking to ${src}
target="${lib}/3dm-0.1.5b1.jar"
sha="db50bfa18a16e8f8d8b8a7e34066d3d5427d234f" />
- <!-- Bouncy Castle. We're sorry for the inconvenience (25MB archive). -->
- <wget id="bouncy-castle-cldc"
- href1="file:///tmp/crypto-140.tar.gz"
- href2="http://bouncycastle.org/download/crypto-140.tar.gz"
- target="${lib}/bouncy-castle-cldc-1.40.zip"
- target.get="${temp.file}"
- unpack1="unpack-tgz"
- unpack2="unpack-tgz"
- unpackloc1="crypto-140/zips/cldc_classes.zip"
- unpackloc2="crypto-140/zips/cldc_classes.zip"
- sha="2c7ff4f406f71595abd72fe8a992767a26e72c78" />
-
<!-- Apache commons-codec -->
<wget id="commons-codec"
href1="http://archive.apache.org/dist/commons/codec/binaries/commons-codec-1.3.zip"
View
@@ -1,6 +1,5 @@
# List of path elements in fuego core common pool
# needed to run the software
-${fc.contrib}/bouncy-castle-cldc.zip
${fc.contrib}/commons-codec-1.3.jar
${fc.contrib}/commons-fileupload-1.0.jar
${fc.contrib}/commons-httpclient-3.0-rc2.jar
View
@@ -2,7 +2,6 @@ ${fc.contrib}/commons-logging-1.1.1.jar
${fc.contrib}/xmlpull_1_1_3_4c.jar
# List of path elements in fuego core common pool
# needed to run the software
-${fc.contrib}/bouncy-castle-cldc-1.40.zip
${fc.contrib}/commons-codec-1.3.jar
${fc.contrib}/commons-fileupload-1.0.jar
${fc.contrib}/commons-httpclient-3.0.jar
@@ -12,7 +12,6 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
-import java.math.BigInteger;
import java.net.URI;
import java.net.URL;
import java.util.ArrayList;
@@ -22,8 +21,6 @@
import java.util.Map;
import java.util.TimeZone;
-import org.bouncycastle.crypto.AsymmetricCipherKeyPair;
-import org.bouncycastle.crypto.params.RSAKeyParameters;
import org.kxml2.io.KXmlParser;
import fc.xml.xas.EndDocument;
@@ -47,7 +44,6 @@
public class XmlData {
static final String TEST_NS = "http://www.hiit.fi/fuego/fc/test";
- private static final AsymmetricCipherKeyPair keyPair;
private static final Map<XasFragment, Integer> sigCounts = new IdentityHashMap<XasFragment, Integer>();
static StartDocument sd;
@@ -59,17 +55,6 @@
private XmlData() {
}
- static {
- BigInteger modulus = new BigInteger(
- "114223138481062383818743472854345446729415521820579721478671411120076686448918620302220709845014730631814478188984612465856840519852245805751892337820823145686311359090114506894126920369485682523288840662511969165284005936035859388250282090838456799125935768645086141305672131191153192376610593502582005436827");
- BigInteger pub = new BigInteger("65537");
- BigInteger priv = new BigInteger(
- "70156155961948275567326563815950795233214260644274158546789757111501088844901677266662957312531515817361615431606536850758127492036749476157451855811245452516036408423715290481767027536732741413397901727264890487785997545700283017129062803344411768517700818077537872436050914359831030152123534899150431708577");
- RSAKeyParameters privParam = new RSAKeyParameters(true, modulus, priv);
- RSAKeyParameters pubParam = new RSAKeyParameters(true, modulus, pub);
- keyPair = new AsymmetricCipherKeyPair(pubParam, privParam);
- }
-
private static XasFragment convert(ItemSource source) throws IOException {
List<Item> items = new ArrayList<Item>();
@@ -83,11 +68,6 @@ private static XasFragment convert(ItemSource source) throws IOException {
}
- public static AsymmetricCipherKeyPair getKeyPair() {
- return keyPair;
- }
-
-
public static List<XasFragment> getData() throws IOException {
List<XasFragment> result = new ArrayList<XasFragment>();
// BUG-20070204-1: This does not work in the Xebu project due
View
@@ -55,6 +55,18 @@
public static void main(String[] args) throws IOException {
Log.setLogger(new StreamLogger(System.err));
+ java.io.StringWriter writer = new java.io.StringWriter();
+ try {
+ javax.xml.stream.XMLStreamWriter xmlWriter = javax.xml.stream.XMLOutputFactory.newInstance().createXMLStreamWriter(writer);
+ xmlWriter.writeStartDocument();
+ xmlWriter.writeStartElement("ns", "foo", "http://www.example.com/namespace");
+ xmlWriter.writeAttribute("bar", "baz");
+ xmlWriter.writeEndElement();
+ xmlWriter.writeEndDocument();
+ Log.info(writer.toString());
+ } catch (javax.xml.stream.XMLStreamException e) {
+ Log.info(e);
+ }
Class encoder = fc.xml.diff.encode.XmlDiffEncoder.class;
Class filter = DataItems.class;
String encoderName = System.getProperty("encoder");
@@ -114,7 +126,6 @@ public static boolean diff(ItemSource baseEs, XmlPullParser baseParser, ItemSour
List<Item> preamble = new ArrayList<Item>();
List<Item> base = IoUtil.makeEventList(baseEs, preamble, posListBase, baseParser);
List<Item> doc = IoUtil.makeEventList(docEs, null, posListNew, docParser);
- Log.debug(base.toString());
GlMatcher<Item> m = new GlMatcher<Item>(IoUtil.getEventHashAlgorithm());
List<Segment<Item>> ml = m.match(base, doc, CHUNK_SIZES);
long _stop = System.currentTimeMillis();

0 comments on commit 0b9ba8f

Please sign in to comment.