Elliptic Curve sample

The sample in the ecdsa folder illustrates the use of Elliptic Curve Digital Signature Algorithms (ECDSA).

  • Generates and registers an ECDSA key pair.

  • Signs data.

  • Verifies the data signature.

See below for how to compile and run the sample.

Compiling ECDSAExample.java

Run the following command line in the etjava/examples directory.

javac -sourcepath source -d classes -classpath ../lib/enttoolkit.jar source/com/entrust/toolkit/examples/ecdsa/ECDSAExample.java

Running ECDSAExample

Run the following command line in the etjava/examples directory.

java -classpath classes;<path to enttoolkit.jar> com.entrust.toolkit.examples.ecdsa.ECDSAExample

For example:

C:\etjava\examples>java -classpath classes;../lib/enttoolkit.jar com.entrust.toolkit.examples.ecdsa.ECDSAExample
 
Registering a named curve over a prime field...DONE
Registering a named curve over a characteristic two field...DONE
Generating key pair... DONE
Creating signature... DONE
Verifying signature... VALID