Building an 'Activation Key' Generator in JAVA
- by jax
I want to develop a Key generator for my phone applications. Currently I am using an external service to do the job but I am a little concerned that the service might go offline one day hence I will be in a bit of a pickle.
How authentication works now.
Public key stored on the phone.
When the user requests a key the 'phone ID' is sent to the "Key Generation Service" and the encrypted key key is returned and stored inside a license file.
On the phone I can check if the key is for the current phone by using a method getPhoneId() which I can check with the the current phone and grant or not grant access to features.
I like this and it works well, however, I want to create my own "Key Generation Service" from my own website.
Requirements:
Public and Private Key
Encryption:(Bouncy Castle)
Written in JAVA
Must support getApplicationId() (so that many applications can use the same key generator) and getPhoneId() (to get the phone id out of the encrypted license file)
I want to be able to send the ApplicationId and PhoneId to the service for license key generation.
Can someone give me some pointers on how to accomplish this? I have dabbled around with some java encryption but am definitely no expert and can't find anything that will help me.
A list of the Java classes I would need to instantiate would be helpful.