Creating key code protection for my application ?






In which "corner of java world" I need to look to create something with
which will my desktop application, through the Net, get a key code which
will permite user to use it.
I imagine something like this: connect to my site (through the my
application) and get a key code which is specified for that machine or
leave some peraonall data which I can compare with the invoice data of a
buyers. Do you have some other idea?
Is it jsp a good solution for that problem ?


Could you please show me a way.

p.s.
the reasons for solving that problem are:
1. to protect my application of ilegall using
2. After j2SDK, I want to start learning j2EE and I was thinking that the
creating a usefull jsp is a good begining.
.