mi::neuraylib::ILibrary_authenticator Class Reference
[Configuration Interfaces]
Description
This interface is used for authenticating the application against the library. Different variants of the use different mechanisms to prevent unauthorized use of the library.
The application needs to prove against the library that it has a valid secret key which enables it to start the .
Public Member Functions
- virtual const IString* get_host_id() const =0
- Returns the host ID of the machine the program is running on. More...
- virtual const IString* get_last_error_message() const =0
- Returns the last error message related to authentication. More...
- virtual Uint64 get_trial_seconds_left() const =0
- Returns the number of seconds left for time-limited licenses. More...
- virtual bool is_trial_license() const =0
- Indicates whether the license provided for authentication is a time-limited license. More...
Static Public Member Functions
- static Sint32 authenticate( const INeuray* library, const char* vendor_key, Size vendor_key_length, const char* secret_key, Size secret_key_length, Sint32 count = 1)
- Convenience function implementing the full library authentication. More...
Member Functions
- static Sint32 mi::neuraylib::ILibrary_authenticator::authenticate( const INeuray* library, const char* vendor_key, Size vendor_key_length, const char* secret_key, Size secret_key_length, Sint32 count = 1) [inline, static]
-
Convenience function implementing the full library authentication. The embedding application needs to pass in a pointer to the mi::neuraylib::INeuray interface, the vendor key and the secret key. The function will then perform the authentication towards the library.
The function is inline to avoid passing the secret key to the which would enable eavesdroppers to get the key. Keys are supposed to be entered as delivered to the application writer (which are hex encoded byte arrays).
Parameters
- library
- A pointer to an instance of mi::neuraylib::INeuray. The method attempts to authenticate this instance of the library.
- vendor_key
- The vendor key assigned to the application writer.
- vendor_key_length
- The size of the vendor key.
- secret_key
- The secret key provided to the application writer.
- secret_key_length
- The size of the secret key.
- count
- The number of licenses to retrieve.
Returns
Indicates errors in the authentication attempt. Returns 0 if there was no error, or negative values in case of errors. Note that a value of 0 does not imply that the key is valid. Key validity is checked during startup, i.e., in mi::neuraylib::INeuray::start() .
- virtual const IString* mi::neuraylib::ILibrary_authenticator::get_host_id() const [pure virtual]
-
Returns the host ID of the machine the program is running on. The host ID is a unique identifier of the machine which can be used to lock a license to a machine.
- virtual const IString* mi::neuraylib::ILibrary_authenticator::get_last_error_message() const [pure virtual]
-
Returns the last error message related to authentication.
Returns
The last error message, or NULL if there is no such error message available.
- virtual Uint64 mi::neuraylib::ILibrary_authenticator::get_trial_seconds_left() const [pure virtual]
-
Returns the number of seconds left for time-limited licenses.
Note:A time-limited license might be either a trial license or a long-running license.
Returns
The number of seconds left before a time-limited license expires, or mi::base::numeric_traits<mi::base::Uint64>::max() for permanent licenses (or has not yet been started).
- virtual bool mi::neuraylib::ILibrary_authenticator::is_trial_license() const [pure virtual]
-
Indicates whether the license provided for authentication is a time-limited license.
Note:A time-limited license might be either a trial license or a long-running license.
Returns
true if license is a time-limited license, false otherwise (including has not yet been started)