I want to provide my application with simple licensing mechanism based on RSA algorithm.
Are there any free RSA libraries?
Just use the javax.crypto and java.security packages. It's in the Java standard platform.
KeyPair keys = KeyPairGenerator.getInstance("RSA").generateKeyPair();
Cipher cipher = Cipher.getInstance("RSA");
cipher.init(Cipher.ENCRYPT_MODE, keys.getPublic());
byte[] encrypted = cipher.doFinal(rawData);
Links for the official documentation:
Yes, check out BouncyCastle.
If for some reason you don't want to use what is build into the platform, then Keyczar is generally the most suggested / best solution for any other sort of cryptographic needs.
I recently used the open source framework Jasypt http://www.jasypt.org/index.html. This framework also work very well together with Spring and Hibernate