tags:

views:

432

answers:

2

I'd like to implement a software licensing scheme. I like the looks of the TrueLicense package in Java, but it's overkill, and I need to validate a license file not just in Java, but in C on both Windows and Linux.

Can anyone suggest an approach and/or libraries or tools to validate an encrypted file across Java and C, Linux and Windows? I'm new to encryption, so a quick and simple implementation is likely best, but I'd like to use a public/private key system and a normal keystore.

Thanks

+1  A: 

Not sure from your question if this is the answer you were looking for, but a portable C++ library that may help you is Crypto++ .

Virgil
+1  A: 

Openssl is also portable between Linux/Windows and can be either called from Java or the results used within Java

laura
True, but I would rather not use a JNI solution. There does seem to be a way to find common ground between Java's packages and OpenSSL, but it does not seem to be straight forward and examples are not to be found. One possibility I found it to use not-yey-commons in Java. It has an OpenSSL compatible password-based encryption. That would allow be to encypt/decypt a license file in Java and in C. I might setting for that, but a public/private key system would be better.
Is this of no use to you?http://java.sun.com/javase/6/docs/api/java/security/package-summary.htmlThe java.security.cert.* package generates fully openssl-compatible certificates (and private keys for those certificates) - I had assumed the rest of java.security would be compatible as well. Or possible I don't understand your question very well
laura