I had a customer with a requirement to be able to add a license key to an Enterprise installation from their application. My first thought was "Nope, can't be done" until I looked into it further and found that I was completely wrong :)
Using the Java Enterprise SDK you can add a keycode to Enterprise. As for .NET, there seems to be a setLicenseKey off the ILicenseKey in .NET, but it is not documented and I have not tested it.
Here is the code:
bq. Add Keycode Good luck on your projects! Jason