VLScgDecodeLicenseExt

Syntax

int VLScgDecodeLicenseExt (VLScg_HANDLE iHandle, char *any_license_string, char *license_string, 
			  int *license_string_buflen, codeT *codeP);

 

Argument Description
iHandle

The instance handle for this library.

any_license_string

The license string to be decoded. An IN parameter.

license_string

Buffer allocated by the caller to receive the decoded license string. An OUT parameter.

license_string_buflen

Length of decoded license string returned.

codeP

Pointer to the CodeT structure filled by the VLScgDecodeLicenseExt 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

This API function decodes the license code passed as any_license_string and places the corresponding codeT structure in the codeP argument. The difference between VLScgDecodeLicense and VLScgDecodeLicenseExt is that the latter API requires that all memory is allocated by the caller.

To decode a license:

1.First call the VLScgInitialize API to allocate resources required for decoding a license.

2.Then, call the VLScgDecodeLicenseExt API to decode the license.

3.And then, call VLScgCleanup API to clean up the resources created by VLScgInitialize API.  

NOTE    When decoding a license via the VLScgDecodeLicenseExt 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_INPUT

Argument specified is not correct, that is, one of the following reasons exist:

>any_license_string or CodeP is NULL

> If license_string is not NULL and license_string_buflen is NULL.

> If license_string is not NULL and license_string_buflen is <= 0

> If any_license_string buffer size exceeds the maximum size limit specified as VLS_MAX_LICENSE_SIZE.

VLScg_DECRYPT_FAIL

This error code indicates that the API has failed to decode the specified license due to invalid license signature. The license signature refers to the authentication string passed along with the license string.

VLS_CALLING_ERROR

The argument specified is not correct.

LS_NO_RESOURCES

Error occurred in allocating resources needed by this API.

LS_BUFFER_TOO_SMALL

Allocated buffer is insufficient for this API.

VLScg_VENDOR_ENCRYPTION_FAIL

Error occurs if vendor-customized encryption fails.

VLScg_MALLOC_FAILURE

Out of heap memory.

VlsCG_SHORT_STRING

Error occurs when the license code too small to parse.

VLScg_PREMATURE_TERM

Premature termination of license code.

VLScg_INVALID_CHARS

String is not valid.

VLScg_FIXED_STR_ERROR

Default fixed string error.

VLScg_INVALID_RANGE

Value violates the valid range of input.

VLScg_SIMPLE_ERROR

Error in license code.

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