Java, SSHJ and EDDSA..Or…”Where Did I Left My Keys?”

For a long time I kept putting Oracle Database related posts, but as one can see in my profile, I also love to dabble with Java programming..While developing a custom way of getting an alert for a specific purpose (OEM let me down and I decided to have one created completely customized to my environment and because I love to program in my spare (oh, trust me, it’s SPARE) time..

Long story short: I needed ssh access to a machine (with Java) and chose to use sshj instead of the jsch with I have more experience with. but is kind of…outdated? Don’t get me wrong, it still does what’s advertised, but it’s documentation is kind of sparse to say the least..

After adding sshj-0.15.0.jar (along with the supporting libs) to my build-path I gave my litte setup a spin..

Supporting libs:
– slf4j-simple-1.7.14.jar
– slf4j-api-1.7.14.jar- bcprov-jdk15on-154.jar (optional)

and she-bang it went….

[main] INFO net.schmizz.sshj.common.SecurityUtils – BouncyCastle registration succeeded
Exception in thread “main” java.lang.NoClassDefFoundError: net/i2p/crypto/eddsa/spec/EdDSAParameterSpec
at net.schmizz.sshj.common.KeyType.<clinit>(KeyType.java:176)
at net.schmizz.sshj.transport.verification.OpenSSHKnownHosts$EntryFactory.parseEntry(OpenSSHKnownHosts.java:210)
at net.schmizz.sshj.transport.verification.OpenSSHKnownHosts.<init>(OpenSSHKnownHosts.java:69)
at net.schmizz.sshj.SSHClient.loadKnownHosts(SSHClient.java:616)
at net.schmizz.sshj.SSHClient.loadKnownHosts(SSHClient.java:596)
at org.blackbox.JTableSpaceCheck.units.remote.RemoteConnect.getTNSNames(RemoteConnect.java:31)
at org.blackbox.JTableSpaceCheck.JTableSpaceCheck.main(JTableSpaceCheck.java:21)
Caused by: java.lang.ClassNotFoundException: net.i2p.crypto.eddsa.spec.EdDSAParameterSpec
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
… 7 more

I googled and googled, and although I did found the site with some java classes with the EDDSA encryption, and also found out, this was some encryption schema, I did not find the JAR file I could slam onto my project. Sure, I could download some source from a GITHUB site, and create a JAR myself, I would probably keep running in the missing ‘EdDSAParameterSpec’ file..since I couldn’t find this.

Until I found this site: I2P

On this site it is not really apparent, but, yes, the JAR file we (since you stumbled on this page) are looking for is hidden..

Download the package i2pinstall_0.9.24.jar (based on the platform of choice, I choose linux since I develop on this platform) and follow the instructions to “install” this file. I choose the graphical version, and unpacked the goodies in my homedir in a tmp folder.

Selection_002.png

After the installation (unpacking is more apt) the folder <install_loc>/i2p is created, and within this the folder lib. Navigate to this folder, and lo and behold: there is a JAR file called: i2p.jar.

This file is the one we need/want: it contains the EDDSA classes, including the spec file. Copy this file into the classpath to build the app, and the pesky errorstack will be gone!

It took me some searching, and since Google didn’t help me out in the speedy way it normally does, I hope to contribute in some small way to help you out..

Happy coding!

Advertisements

About GemsOfProgramming

Beeing a previously enthusiastic Java programmer, I rolled into the Oracle Database Administration world. It turned out I got a knack for this, and since approx. 2000 I'm a full time DBA. My experiences touches lot of Oracle products like Forms and Reports 9/10, JDAPI, Application Server, Weblogic Fusion and of course: Oracle Enterprise Databases, JavaFX, Swing and other Java components.
This entry was posted in Java, Technical Stuff and tagged , , . Bookmark the permalink.

2 Responses to Java, SSHJ and EDDSA..Or…”Where Did I Left My Keys?”

  1. Rodrigo says:

    You can include via maven, or download it from maven repository. Instructions below:
    http://javahonk.com/java-lang-classnotfoundexception-net-i2p-crypto-eddsa-spec-eddsaparameterspec/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s