ActivateLicense static method

int ActivateLicense()

Activates the license by contacting the Cryptlex servers.

Returns LexStatusCodes LA_OK, LA_EXPIRED, LA_SUSPENDED, and LA_FAIL.

It validates the key and returns with encrypted and digitally signed token which it stores and uses to activate your application. This function should be executed at the time of registration, ideally on a button click.

The function throws a LexActivatorException on error.

Implementation

static int ActivateLicense() {
  int status = _lexActivatorNative.ActivateLicense();
  switch (status) {
    case LexStatusCodes.LA_OK:
      return LexStatusCodes.LA_OK;
    case LexStatusCodes.LA_EXPIRED:
      return LexStatusCodes.LA_EXPIRED;
    case LexStatusCodes.LA_SUSPENDED:
      return LexStatusCodes.LA_SUSPENDED;
    case LexStatusCodes.LA_FAIL:
      return LexStatusCodes.LA_FAIL;
    default:
      throw LexActivatorException(status);
  }
}