How do I get AO / JCE to work with Java 1.4?

According to http://www.jcraft.com/jsch/ ,JSch is in pure Java, but it depends on Java Cryptography Extension (JCE). JSch has been known to work with J2SE 1.4.0 or later (no additional libraries required).

Before anyone suggests I upgrade (which would really make my life easier), this is not an option: I need to get this to work under Java 1.4.2.

So, I downloaded the JSch 0.1.54 source (and the JZLib 1.1.3 source) and fixed a few minor issues here and there. The rest of the sticking point is JCE. Without it, the following classes (found in java.security.interfaces

since Java 1.5) are missing:

Error:(40, 3) java: cannot find symbol
  symbol:   class ECFieldFp
  symbol:   class ECGenParameterSpec
  symbol:   class ECParameterSpec
  symbol:   class ECPoint
  symbol:   class ECPrivateKey
  symbol:   class ECPrivateKeySpec
  symbol:   class ECPublicKey
  symbol:   class ECPublicKeySpec
  symbol:   class EllipticCurve

      

Where is the source or JCE pitcher that will fill this need? Bouncy Castle's page ( https://www.bouncycastle.org/latest_releases.html ) seems to be part of the solution, but there is confusion about the download selection for Java 1.4. I tried it lcrypto-jdk14-157

, but it was incomplete compared to the list above: it only supplies ECPoint

and ECPrivateKey

.

+3


source to share


1 answer


According to the changelog, support has been added since version 0.1.52 . These classes are used in the com/jcraft/jsch/jce/KeyPairGenECDSA.java

, KeyPairECDSA.java

, ECDH.hava

, SignatureECDSA.java

and other new files to support ECDSA

.

If you don't need to connect a server only supported by key ECDSA

. The solution downloads the source code from sourceforge.net creating a jar file using JDK 1.4.2. There is one compatible problem:



jsch-0.1.51/src/main/java/com/jcraft/jsch/Util.java:490: replace(char,char) in java.
lang.String cannot be applied to (java.lang.String,java.lang.String)
    str = str.replace("~", System.getProperty("user.home"));

      

All you need is a fix for this error.

+1


source







All Articles