How can I edit a .class in rt.jar to support arbitrary Elliptic Curves

278 Views Asked by At

I am trying to change the ECParameters class in sun.security.ec. I need to do this in order to get arbitrary curves working, and I already downloaded the OpenJDK source, edited the code and compiled it again.

I unpacked my current rt.jar and replaced all the files in sun.security.ec with my own compiled files. Everything looks right, but when I compile it again and try to start netbeans nothing happens..

Does anyone know what I did wrong, and how I should do it properly?

Edit: I have read that it is not recommended to edit these classes, but this particular class even has a piece of code that is commented out.

// The code below is incomplete.
//It is left as a starting point for a complete parsing implementation.
1

There are 1 best solutions below

3
On

It is not a good idea to change compiled JDK classes. Why you don't use "normal" ways to implement your case? As you already mentioned that it isn't a good way you could use the commented code you've found e.g. to implement an util class.