/// <summary>
/// Open IntelliLock Project
/// </summary>
public IntelliLock.LicenseManager.ProjectFile ReadProjectFile(string proj_filename)
{
return new IntelliLock.LicenseManager.ProjectFile(proj_filename);
}
/// <summary>
/// Create License File
/// </summary>
public byte[] CreateLicenseFile(string proj_filename)
{
IntelliLock.LicenseManager.ProjectFile myproject = new IntelliLock.LicenseManager.ProjectFile(proj_filename);
myproject.LicenseInformation.Add("MyKey", "MyValue");
return IntelliLock.LicenseManager.LicenseGenerator.CreateLicenseFile(myproject);
}
/// <summary>
/// Create License File
/// </summary>
public void CreateLicenseFile(string proj_filename, string license_filename)
{
IntelliLock.LicenseManager.ProjectFile myproject = new IntelliLock.LicenseManager.ProjectFile(proj_filename);
myproject.LicenseInformation.Add("MyKey", "MyValue");
IntelliLock.LicenseManager.LicenseGenerator.CreateLicenseFile(myproject, license_filename);
}
/// <summary>
/// Create Hardware Locked License File
/// </summary>
public void CreateLicenseFile(string proj_filename, string license_filename)
{
IntelliLock.LicenseManager.ProjectFile myproject = new IntelliLock.LicenseManager.ProjectFile(proj_filename);
myproject.LicenseInformation.Add("MyKey", "MyValue");
myproject.HardwareLock_Enabled = true;
myproject.HardwareLock_BIOS = true;
myproject.HardwareLock_CPU = true;
myproject.HardwareLock_HDD = true;
myproject.HardwareLock_MAC = false;
myproject.HardwareLock_Mainboard = true;
myproject.HardwareLock_OS = false;
myproject.Hardware_ID = "B745-C55C-1B94-6250-E98E-9BA0";
IntelliLock.LicenseManager.LicenseGenerator.CreateLicenseFile(myproject, license_filename);
}
/// <summary>
/// Read License File
/// </summary>
public IntelliLock.LicenseManager.ProjectFile ReadLicenseFile(string proj_filename, string license_filename)
{
IntelliLock.LicenseManager.ProjectFile myproject = new IntelliLock.LicenseManager.ProjectFile(proj_filename);
return myproject.ReadLicenseFile(license_filename);
}
/// <summary>
/// Read License File
/// </summary>
public IntelliLock.LicenseManager.ProjectFile ReadLicenseFile(string proj_filename, byte[] license)
{
IntelliLock.LicenseManager.ProjectFile myproject = new IntelliLock.LicenseManager.ProjectFile(proj_filename);
return myproject.ReadLicenseFile(license);
}
/// <summary>
/// Generate Reactivation Code
/// </summary>
public string GenerateReactivationCode(string proj_filename, string deactivation_code, string hardware_id)
{
IntelliLock.LicenseManager.ProjectFile myproject = new IntelliLock.LicenseManager.ProjectFile(proj_filename);
//use the same hardware components you used to deactivate the license
return LicenseReactivator.GenerateReactivationCode(myproject, deactivation_code, hardware_id, true, false, true, true, true, false);
}
/// <summary>
/// Encrypt And Sign Data
/// </summary>
public byte[] EncryptAndSignData(string proj_filename, byte[] mydata)
{
IntelliLock.LicenseManager.ProjectFile myproject = new IntelliLock.LicenseManager.ProjectFile(proj_filename);
return IntelliLock.LicenseManager.DataSignHelper.EncryptAndSignData(myproject, mydata);
}
/// <summary>
/// Verify Signature
/// </summary>
public bool VerifySignature(string proj_filename, byte[] mydata)
{
IntelliLock.LicenseManager.ProjectFile myproject = new IntelliLock.LicenseManager.ProjectFile(proj_filename);
return IntelliLock.LicenseManager.DataSignHelper.VerifySignature(myproject, mydata);
}
/// <summary>
/// Decrypt Data
/// </summary>
public byte[] DecryptData(string proj_filename, byte[] mydata)
{
IntelliLock.LicenseManager.ProjectFile myproject = new IntelliLock.LicenseManager.ProjectFile(proj_filename);
if (IntelliLock.LicenseManager.DataSignHelper.VerifySignature(myproject, mydata))
{
return IntelliLock.LicenseManager.DataSignHelper.DecryptData(myproject, mydata);
}
else
return new byte[0];
}
|