signalapp / curve25519-java

Pure Java and JNI backed Curve25519 implementation.
GNU General Public License v3.0
232 stars 93 forks source link

Add compatibility with java.security.* API #35

Closed cmoine closed 4 years ago

cmoine commented 4 years ago

Hi, my question might be completely stupid, but I would like to combine Curve25519 with ED25519.

The ED25519 library requires a java.security.PrivateKey, and I cannot find a way to create it from the byte[] generated by this library. Is there a specific reason for not providing Security.addProvider(...)

I did not use Bouncy Castle (which supports Curve25519) because:

Any idea on how to properly convert the byte array into a java.security.PrivateKey?

cmoine commented 4 years ago

Sorry, I think it actually doesn't make any sense to pass the result of Curve25519 to an Ed25119. The private key doesn't come from Curve25519, but from a .PEM or .DER file. Sorry for so much confusion from my side.