LicenceDomain
Description
The LicenceDomain class represents the client-side functionality of a licence domain.
Public / Methods
GenerateLicenceKeySetup
Generates a source code fragment for C# resp. C++ which reconstructs a licence key string using some pseudo-random arithmetic.
You can use the source code fragment if you do not want to embed the licence key as a string literal into your binary.
The C# code fragment looks like this:
// Tinman 3D licence key: // CIk!6Dh6Ui;lSE+Z{{jx7$Y~8,#TSt~o%CK#(e,F#O9.d;fGc+bU35%HVl;[.+s#@h.bo1~{riL.4|UreHfeuac}5ZV~DBocxU}@ { sbyte[] licenceKeyData; licenceKeyData = new sbyte[N+1]; licenceKeyData[0] = ?; licenceKeyData[1] = (sbyte) (licenceKeyData[0] op ?); ... licenceKeyData[N] = (sbyte) (licenceKeyData[N-1] op ?); licenceKey = global::Tinman.Core.StringUtil.BinaryDecode(licenceKeyData); }
The C++ code fragment looks like this:
// Tinman 3D licence key: // CIk!6Dh6Ui;lSE+Z{{jx7$Y~8,#TSt~o%CK#(e,F#O9.d;fGc+bU35%HVl;[.+s#@h.bo1~{riL.4|UreHfeuac}5ZV~DBocxU}@ { CodeX::Array<int8> licenceKeyData(N+1); licenceKeyData[0] = ?; licenceKeyData[1] = static_cast<CodeX::int8> (licenceKeyData[0] op ?); ... licenceKeyData[N] = static_cast<CodeX::int8> (licenceKeyData[N-1] op ?); licenceKey = ::Tinman::Core::StringUtil::BinaryDecode(licenceKeyData); }
where 'licenceKey'
is the variable name that has been specified via the variableName opt parameter, N+1
is the buffer length and op
and ?
perform pseudo-random arithmetic operations.
LicenceKey
Specifies a licence key that shall be used to unlock this licence domain.
Each licence key is a string of 100 characters, interpreted as a base-85 number using printable ASCII characters as digits (whitespaces are ignored). These characters will never be used in a licence key string:
"&'/<>\]`
This allows licence keys to be put into string literals or XML files, see LicenceKeyNormalize for additional information. Here is an example key:
CIk!6Dh6Ui;lSE+Z{{jx7$Y~8,#TSt~o%CK#(e,F#O9.d;fGc+bU35%HVl;[.+s#@h.bo1~{riL.4|UreHfeuac}5ZV~DBocxU}@
Please note that the example key above is invalid. You must specify at least one valid one before using the Tinman 3D SDK.
An application can specify any number of licence keys. Upon first call to Unlock request, the licence domain is unlocked; for this at least one valid licence key must have been specified. All invalid licence keys are ignored silently.
A licence key can optionally be specified via a user environment variable named {NAME}_LICENCEKEY
, where {NAME}
is the value of Name, converted to uppercase. Licence keys specified via LicenceKey have precedence over the environment variable key.
LicenceKeyEscape
Returns a StringEscape object that can be used to create modified licence keys, as described by see LicenceKeyNormalize.
LicenceKeyNormalize
Normalizes the given licence key string.
A licence key is normalized like this:
-
The following character substitutions are performed on the given licence key string:
'&' => '#' '"' => '(' '\'' => '(' '/' => '$'
This makes sure that a modified licence key string can be put into the
/etc/environment
or~/.profile
file of a Unix/Linux system:-
Avoid truncation of licence key after special comment character
'#'
. -
Avoid breaking of command
'apt upgrade'
, because of unexpected'('
character. -
Avoid wrong interpretation of
…$abc…
as a variable.
-
-
All invalid characters are discarded (i.e. all non-base-85 characters).
This will remove all whitespaces resp. line-breaks (e.g. resulting from copy & paste). -
If the resulting string length is not 100, the entire string is discarded and set to
null
.
- See also
Request
2 overloads
Formulates a licence request for this licence domain.
The licence request is a human-readable JSON value (see JsonValue.From1). The licence request file is a text file with UTF-8 encoding (see CharacterEncoding.UTF_8) and leading byte-order marks.
When a licence key is granted for the returned request, it will allow the enclosing environment (see LicenceFlags) to activate this licence domain.
- IOException
-
If an I/O error has occurred.
Formulates a licence request for this licence domain.
The licence request is a human-readable JSON value (see JsonValue.From1). The licence request file is a text file with UTF-8 encoding (see CharacterEncoding.UTF_8) and leading byte-order marks.
When a licence key is granted for the returned request, it will allow the enclosing environment (see LicenceFlags) to activate this licence domain.
- IOException
-
If an I/O error has occurred.
TryUnlock
Checks if this licence domain has been unlocked.
When this licence domain is still unlocked, the method will try to unlock it using the set of specified licence keys (see LicenceKey). On success, the program will continue to execute normally. On failure, an exception will be thrown.
Unlock
Checks if this licence domain has been unlocked.
When this licence domain is still unlocked, the method will try to unlock it using the set of specified licence keys (see LicenceKey). On success, the program will continue to execute normally. On failure, an exception will be thrown.
- LicenceException
-
If this licence domain is still locked.
UnlockContent
Unlocks a protected content file.
The unlocked content will be written to a file having the same path as content in, without the file suffix: '.lic'
.
- IOException
-
If an I/O error has occurred.
UnlockInt32s
Unlocks a protected integer array.
- LicenceException
-
If this licence domain is still locked.
UnlockInt8s
Unlocks a protected byte array.
- LicenceException
-
If this licence domain is still locked.
UnlockString
Unlocks a protected string value.
- LicenceException
-
If this licence domain is still locked.
Public / Attributes
AllowUnlockByEnvironment
Allow licence domain to be unlocked via licence key found in environment variable?
After the licence domain has been unlocked, setting this property has no longer any effect.
Defaults to true
.
IsUnlockedByApplication
Is this licence domain being activated from one of the licence keys that have been specified via LicenceKey?
The TryUnlock method is called each time this property is get.
IsUnlockedByEnvironment
Is this licence domain being activated from the licence key that has been specified in the environment variable (see LicenceKey)?
The TryUnlock method is called each time this property is get.
Tinman
The licence domain of the Tinman 3D SDK (tinman_3d
).
To obtain a new licence manually, you can use the Request2 and Request1 methods in your application to generate a licence request. Include the licence request file in your email to sales@tinman3d.com
and we will be happy to complete your licence request. If you have any other questions, please send an email to: info@tinman3d.com
.
According to LicenceKey, the environment variable for the Tinman 3D SDK is this:
TINMAN_3D_LICENCEKEY = ...