OpenSSL compatible API for Scala?
I'm working on a project with a friend. He's implementing his software in Ruby and I'm doing my stuff in Scala (with Lift). We're using some asynchronous encryption and he is using the ruby OpenSSL bindings for that:
key = OpenSSL::PKey::RSA.generate(4096)
self.public_key = key.public_key
self.private_key = key
What I'm looking for is a simple API which is compatible to OpenSSL and runs on the JVM. I need it to create key-pairs and to encrypt and sign开发者_高级运维 our payload. Do you have any suggestions?
How about using the API available in the JDK? javax.crypto.*
A college has been using it for SSL related stuff (using a cert and RSA keys).
Have a look at the Java API docs.
PEM is just header
+ base64(
PKCS#8 encoded key material)
+ footer
; the standard JCE stuff uses PKCS#8 format natively. It's not exactly simple, but it works. :)
精彩评论