licenses
- C
- C++
- CSharp
- Java
- JavaScript
- Python
- Swift
- Go
- PHP
/* Initialize MTE license. If a license code is not required (e.g., trial
mode), this can be skipped. This demo attempts to load the license info
from the environment if required. */
if (!mte_license_init("YOUR_COMPANY", "YOUR_LICENSE"))
{
company = getenv("MTE_COMPANY");
license = getenv("MTE_LICENSE");
if (company == NULL || license == NULL ||
!mte_license_init(company, license))
{
fprintf(stderr, "License init error (%s): %s\n",
mte_base_status_name(mte_status_license_error),
mte_base_status_description(mte_status_license_error));
return mte_status_license_error;
}
}
// Initialize MTE license. If a license code is not required (e.g., trial
// mode), this can be skipped. This demo attempts to load the license info
// from the environment if required.
if (!MteBase::initLicense("YOUR_COMPANY", "YOUR_LICENSE"))
{
const char *company = getenv("MTE_COMPANY");
const char *license = getenv("MTE_LICENSE");
if (company == NULL || license == NULL ||
!MteBase::initLicense(company, license))
{
std::cerr << "License init error ("
<< MteBase::getStatusName(mte_status_license_error)
<< "): "
<< MteBase::getStatusDescription(mte_status_license_error)
<< std::endl;
return mte_status_license_error;
}
}
// Create mte encoder or decoder
MteEnc mteEncoder = new MteEnc();
// Initialize the MTE license
if (!mteEncoder.InitLicense(appSettings.LicenseCompanyName, appSettings.LicenseKey)) {
// MTE cannot continue so this should be dealt with appropriately
// Set encoder status to a license error
_encoderStatus = MteStatus.mte_status_license_error;
// License error, Mte cannot continue handle appropriately
// Below is an example
Log.LogError ("MTE license appears to be invalid. MTE cannot be initalized ({0}): {1}. Press any key to end.",
mteEncoder.GetStatusName(_encoderStatus),
mteEncoder.GetStatusDescription(_encoderStatus));
return;
}
// Initialize the MTE license
if (!MteBase.initLicense(LicenseCompanyName, LicenseKey)) {
// MTE cannot continue so this should be dealt with appropriately
// Set encoder status to a license error
_encoderStatus = MteStatus.mte_status_license_error;
// Build error
System.out.print("MTE license appears to be invalid. MTE cannot be initalized (" + MteBase.getStatusName(_encoderStatus) + ": "
+ MteBase.getStatusDescription(_encoderStatus) + ". Press any key to end");
return;
}
import { MteWasm, MteBase, MteDrbgs } from "mte-wasm-browser";
// instantiate wasm
const mteWasm = new MteWasm();
await mteWasm.instantiate();
// create instance of MteBase
const mteBase = new MteBase(mteWasm, MteDrbgs.mte_drbgs_none);
// initialize MTE license
const initLicenseResult = mteBase.initLicense(licenseCompany, licenseKey);
if (!initLicenseResult) {
const licenseStatus = MteStatus.mte_status_license_error;
const status = mteBase.getStatusName(licenseStatus);
const message = mteBase.getStatusDescription(licenseStatus);
throw new Error(
`MTE license appears to be invalid. MTE cannot be initalized.\n${status}: ${message}`,
);
}
# Initialize the MTE license.
init_license_result = MteBase.init_license(license_company, license_key)
if not init_license_result:
# MTE cannot continue so this should be dealt with appropriately.
# Set encoder status to a license error.
encoder_status = MteStatus.mte_status_license_error
# License error, Mte cannot continue handle appropriately.
# Below is an example.
(status,message) = MteBase.get_status_name(encoder_status),
MteBase.get_status_description(encoder_status)
print("MTE license appears to be invalid. MTE cannot be initalized. ({0}): {1}. Press any key to end".format(
status,
message),
file=sys.stderr)
input()
exit(1)
// Initialize the MTE license
if (!MteBase.initLicense(licenseCompanyName, licenseKey)) {
// MTE cannot continue so this should be dealt with appropriately
print("MTE license appears to be invalid. MTE cannot be initalized")
}
// Initialize the MTE license
if !mte.InitLicense(companyName, companyLicense) {
fmt.Println("MTE license appears to be invalid. MTE cannot be initalized.")
return
}
<?php
define("COMPANY", "companyName");
define("LICENSE", "companyLicense");
// Initialize the MTE license
if(!mte_license_init(COMPANY, LICENSE)){
echo "MTE license appears to be invalid. MTE cannot be initalized.";
return;
}
?>