VLScgDecodeLicense

Syntax

int VLScgDecodeLicense (VLScg_HANDLE iHandle, char *AnyLicenseString, char *lic_string, 
			  int lic_string_length, codeT **codePP);
Argument Description
iHandle

The instance handle for this library.

AnyLicenseString

User-provided license string to be decoded. An IN parameter.

lic_string

Contains the decoded license string. An OUT parameter.

lic_string_length

Length of decoded license string returned.

codePP

Pointer to the CodeT structure filled by the VLScgDecodeLicense API. The members of this structure are filled with the values corresponding to the applicable license properties set at the time of license generation.

Description

The API decodes the license string AnyLicenseString and puts the corresponding codeT struct in the last argument. Pointer to codeT struct is to be passed as the last argument. This pointer will contain the codeT corresponding to AnyLicenseString.

This function takes care of all the memory allocations it uses.

NOTE    When decoding a license via the VLScgDecodeLicense API function, the codeT structure returned does not contain the license secrets—instead the corresponding field contains an empty string.

Returns

The status code VLScg_SUCCESS is returned if successful. Otherwise, it will return the following error codes:

Error Code

Description

VLScg_INVALID_VENDOR_CODE

This error can occur in one of the following scenarios:

>Vendor identification is not valid. Get in touch with the Sentinel RMS sales representative.

>The License Revocation Ticket (LRT)-based revocation method is no longer supported.

VLScg_VENDOR_ENCRYPTION_FAIL

If vendor-customized encryption fails.

VLScg_MALLOC_FAILURE

Out of heap memory.

VLScg_SHORT_STRING

License string too small to parse.

VLScg_PREMATURE_TERM

Premature termination of license string.

VLScg_INVALID_CHARS

String is not valid.

VLScg_EXCEEDS_MAX_STRING

Length of the string is greater than the defined limit.

VLScg_REMAP_DEFAULT

Failed to remap default strings from configuration file for license.

VLScg_DECRYPT_FAIL

Decryption failed for license code.

VLScg_INVALID_CHKSUM

Error occurred either due to invalid lock code or checksum validation failure.

VLScg_FIXED_STR_ERROR

Default fixed string error.

VLScg_INVALID_RANGE

Value violates the valid range of input.

VLScg_INVALID_INPUT

Invalid input.

VLScg_INVALID_INT_TYPE

Value is not numeric.

VLScg_LESS_THAN_MIN_VALUE

Value entered is less than the minimum supported value.

VLScg_INVALID_HEX_TYPE

Wrong value entered. (Should be hexadecimal).

VLScg_SECRET_DECRYPT_FAILURE

Decryption failed for secrets. Verify the configuration file for readable licenses.

VLScg_SIMPLE_ERROR

Error in license string. Please check.

For the complete list of the error codes, refer to License Generation and Revocation Error Codes .