I have C# desktop application which required license to start the application, So the same it will call Java application running on Cloud which will generate the license.
So i have thought to use RSA to encrypt and decrypt license information like License validity.
I have refereed below link :-
RSA .NET encryption Java decryption
Java RSA Encrypt - Decrypt .NET
The problem is I want to encrypt License information in Java using Private key and decrypt in C# using public key.
Yes this is opposite scenario, i will put public key in desktop application that client will have it. Which can read the data, i don't want to disclose private as any one can generated license as they want using private key. I didn't got any solution which can help to achieve this in cross platform.
Is it possible ? I can use AES as well but again the same key for encrption and decryption.
EDIT :
What my application is currently going :-
it will take some unique machine id and generating license (From Java send to desktop) and inside the license we we have this unique id. So when application start that time we check if machine id in license and machine id of current system are same or not.
I am not sure how digital Signature will work in this case? can you please point me any code example. (which can work cross platform)