
public boolean valid_license(char* filename,
char* master_key_str,
int* days_left,
int* feature,
const char* company_name,
const char * appname)
Parameters:
filename - The name of the file
that stores your cutomers license key.
master_key_str - a 136
character key that represents your product.
days_left - The number of days
left before the license expires. If the license is permanent this is set to -1.
feature - This number is stored
in the customer license keys that you create. It has no meaning to
RepublicanDRM but can be used by your software.
company_name – Your company name, used to
create unique obfuscated registry keys.
appname – Your application name,
used to create unique obfuscated registry keys.
Returns:
1 if the key is valid and 0
otherwise.
unsigned char* getmacaddress();
This function extracts the host id (MAC address) of the host on which the software is running.
If there is no valid license for
the host then you should get the host id and display it on the screen, so that
the end user knows what their host id is, for when they purchase a license. You
must free the memory returned by this function using free() when you have
finished with it.
Returns:
A binary (i.e. nonprintable) sequence
representing the MAC address.
char* print_MACaddress(unsigned
char *CryptData);
This function converts the byte
string from getmacaddress() and puts it into a form that is human readable
(i.e. ASCII string).
You must free the memory returned
by this function using free() when you have finished with it.
Parameters:
CryptData - A binary (i.e.
nonprintable) sequence representing a MAC address..
Returns:
An ASCII (i.e.printable) sequence
representing the MAC address..
int
save_license_key_if_valid(char* key,char* filename,char* master_key_str,int*
days_left, int* feature,const char* company_name,const char * appname);
This function first checks that
the license keys is valid. If the key is valid it stores it into the location
given.
Parameters:
key – the ASCII license key
entered by your customer.
filename - The name of the file
that stores your cutomers license key.
master_key_str - a 136
character key that represents your product.
days_left - The number of days
left before the license expires. If the license is permanent this is set to -1.
feature - This number is stored
in the customer license keys that you create. It has no meaning to
RepublicanDRM but can be used by your software.
company_name – Your company name, used to
create unique obfuscated registry keys.
appname – Your application name,
used to create unique obfuscated registry keys.
Returns:
1 if the key is valid and 0
otherwise.
int c_to_java_valid_license(char* filename,char* master_key_str, const char* company_name,const char * appname, char * challenge_str);
This function is used within the license_mgr.exe executable
that implements anti-clock-tampering. You need to compile your own version of
license_mgr.exe compiling in your own master key. The functionality of this
function is the same as valid_license, but the function includes an additional
parameter, which is random number to be encrypted.
Parameters:
filename - The name of the file
that stores your cutomers license key.
master_key_str - a 136
character key that represents your product.
company_name – Your company name, used to
create unique obfuscated registry keys.
appname – Your application name,
used to create unique obfuscated registry keys.
challenge_str – a hexadecimal
string to be encrypted and printed to stdout.
Returns:
1 if the key is valid and 0
otherwise.