Platforms to show: All Mac Windows Linux Cross-Platform

Back to HASPHLDMBS class.

HASPHLDMBS.Close

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 11.1 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Logs out from a context or session.

Called automatically for you by the destructor.

Use this function to end a connection to an API session object. Once logged out from a session, all memory allocated for the session is released.

Lasterror is set.

HASPHLDMBS.Constructor(FeatureID as Integer, scope as string, VendorCode as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 11.1 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Logs into a Feature to establish a session, according to predefined search parameters.

This function is used to specify conditions that describe where login information is to searched for.

The requisite Vendor Codes are stored in a VendorCodes folder in your system. Without the correct Vendor Code, the function call cannot succeed.

You can open up to 512 simultaneous login sessions.

This function does not work with legacy HASP Features.

FeatureID: Unique identifier for a specific Feature stored in a Sentinel HASP protection key
Scope: Definition of the search parameters for this Feature ID. See the additional HASP API Reference documentation for more information about Scope XML Tags.
VendorCode: the vendor code

Lasterror is set. This calls SDK function hasp_login_scope.

See also:

HASPHLDMBS.Constructor(FeatureID as Integer, VendorCode as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 11.1 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Logs into a Feature and thereby establishes a session context.

This function establishes a context to a Sentinel HASP protection key containing a license for the requested Feature ID.
The requisite Vendor Codes are stored in a VendorCodes folder in your system. Without the correct Vendor Code, the function call cannot succeed.

You can open up to 512 simultaneous login sessions.

Legacy HASP Remarks
For local prognum Features, concurrency is not handled and each login performs a decrement if it is a counting license.

Network "prognum" features continue to use the old HASP LM login logic, with its inherent limitations.

There is only support for concurrent usage of one server (global server address).

With "Program Number" features (see HASP_FEATURETYPE_MASK), 8 bits are reserved for legacy options (see HASP_PROGNUM_OPT_MASK, currently 5 bits are used):

  • only local
  • only remote
  • login is counted per process ID
  • disable terminal server check
  • enable access to old (HASP3/HASP4) keys

FeatureID: Unique identifier for a specific Feature stored in a Sentinel HASP protection key
VendorCode: the Vendor Code

Lasterror is set. This calls SDK function hasp_login.

See also:

HASPHLDMBS.DateTimeToHaspTime(day as Integer, month as Integer, year as Integer, hour as Integer, minute as Integer, second as Integer) as memoryblock

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 11.1 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Converts a date and time value to hasptime (the number of elapsed seconds since January 1 1970).

Time values are in UTC.
Memoryblock has 8 bytes.

HASPHLDMBS.DecryptMemory(Data as Memoryblock, DataOffset as Integer, Size as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 11.1 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Decrypts a buffer.

Decrypts data using the decryption engine in the Sentinel HASP protection key.
The specific session handle determines which Sentinel HASP protection key and which Feature ID decrypts the data buffer. The decryption key remains in the Sentinel HASP protection key. If the decryption fails, the buffer is not modified. To encrypt the data buffer, use the Encrypt function.

Data: The data to decrypt.
DataOffset: Start address in Bytes in the memoryblock.
Size: Data size in Bytes in memoryblock. (16 bytes minimum)

Lasterror is set. This calls SDK function hasp_decrypt.

Some examples using this method:

HASPHLDMBS.DecryptString(Data as string) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 11.1 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Decrypts a buffer.

Decrypts data using the decryption engine in the Sentinel HASP protection key.
The specific session handle determines which Sentinel HASP protection key and which Feature ID decrypts the data buffer. The decryption key remains in the Sentinel HASP protection key. If the decryption fails, the buffer is not modified. To encrypt the data buffer, use the Encrypt function.

Data: The data to decrypt.
Returns the decrypted data.
Lasterror is set. This calls SDK function hasp_decrypt.

HASPHLDMBS.EncryptMemory(Data as Memoryblock, DataOffset as Integer, Size as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 11.1 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Encrypts a buffer.

Encrypts data using the encryption engine in the Sentinel HASP protection key.
The specific session handle determines which Sentinel HASP protection key and which Feature ID encrypts the data buffer. The encryption key remains in the Sentinel HASP protection key. If the encryption fails, the buffer is not modified. To decrypt the data buffer, use the Decrypt function.

Data: The data to encrypt.
DataOffset: Start address in Bytes in the memoryblock.
Size: Data size in Bytes in memoryblock. (16 bytes minimum)

Lasterror is set. This calls SDK function hasp_encrypt.

Some examples using this method:

HASPHLDMBS.EncryptString(Data as string) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 11.1 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Encrypts a buffer.

Encrypts data using the encryption engine in the Sentinel HASP protection key.
The specific session handle determines which Sentinel HASP protection key and which Feature ID encrypts the data buffer. The encryption key remains in the Sentinel HASP protection key. If the encryption fails, the buffer is not modified. To decrypt the data buffer, use the Decrypt function.

Data: The data to encrypt. (16 bytes minimum)

Returns encrypted string.

Lasterror is set. This calls SDK function hasp_encrypt.

HASPHLDMBS.GetRTC as memoryblock

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 11.1 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Reads the current time.

Only HASP HL keys with a Real-time clock (rtc) and HASP SL keys can provide the current time.
Primarily used to obtain reliable timestamps that are independent from the system clock.
Time values are returned as the number of seconds that have elapsed since Jan-01-1970 0:00:00 UTC.
This request is only supported on locally accessed keys. Trying to get the time from a remotely accessed key will return HASP_NO_TIME.
Returns time as a 8 byte memoryblock.
Lasterror is set.

Some examples using this method:

HASPHLDMBS.GetSessionInfo(format as string) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 11.1 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Retrieves information regarding a session context.

format: Definition for the type of output data structure, in XML format.
There are three format options:

  • HASP_KEYINFO For retrieving information on the Sentinel HASP protection key
  • HASP_SESSIONINFO For retrieving information on the login session
  • HASP_UPDATEINFO For retrieving information on a license update usually contained in a C2V file. The retrieved information includes the current state of the key, including update counters, license availability and memory images

Returns answer. Lasterror is set.

HASP_KEYINFO is "<haspformat format=""keyinfo""/>"
HASP_SESSIONINFO is "<haspformat format=""sessioninfo""/>"
HASP_UPDATEINFO is "<haspformat format=""updateinfo""/>"

Some examples using this method:

HASPHLDMBS.GetSize(FileID as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 11.1 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Retrieves the byte size of a memory file from a HASP protection key.

This function is used to determine the file size of a HASP memory file.
FileID: Identifier for the file that is to be queried.
Returns file size. Lasterror is set.

Possible File ID constants: HASP_FILEID_LICENSE, HASP_FILEID_MAIN, HASP_FILEID_RO or HASP_FILEID_RW.

Some examples using this method:

HASPHLDMBS.HaspTimeToDateTime(time as memoryblock, byref day as Integer, byref month as Integer, byref year as Integer, byref hour as Integer, byref minute as Integer, byref second as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 11.1 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Converts a time value (elapsed seconds since January 1 1970) into a date and time

Memoryblock has 8 bytes.
Time values are in UTC.

Some examples using this method:

HASPHLDMBS.LegacyDecryptMemory(Data as Memoryblock, DataOffset as Integer, Size as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 11.1 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Legacy HASP4 compatible decryption function.

This object must have been created by calling Constructor() with a "prognum" Feature ID.

Data: The memoryblock where bytes are decrypted.
DataOffset is the start position in Bytes in the memoryblock and size the length of the data block to decrypt.
Size: Size of the data in the memoryblock to decrypt.

Lasterror is set.

Some examples using this method:

HASPHLDMBS.LegacyDecryptString(Data as string) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 11.1 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Legacy HASP4 compatible decryption function.

This object must have been created by calling Constructor() with a "prognum" Feature ID.

Lasterror is set.

HASPHLDMBS.LegacyEncryptMemory(Data as Memoryblock, DataOffset as Integer, Size as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 11.1 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Legacy HASP4 compatible encryption function.

This object must have been created by calling Constructor() with a "prognum" Feature ID.

Data: The memoryblock where bytes are encrypted.
DataOffset is the start position in Bytes in the memoryblock and size the length of the data block to encrypt.
Size: Size of the data in the memoryblock to encrypt.

Lasterror is set.

Some examples using this method:

HASPHLDMBS.LegacyEncryptString(Data as string) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 11.1 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Legacy HASP4 compatible encryption function.

This object must have been created by calling Constructor() with a "prognum" Feature ID.

Lasterror is set.

HASPHLDMBS.LegacySetIdleTime(idletime as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 11.1 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Set the LM idle time.

This object must have been created by calling Constructor() with a "prognum" Feature ID.

time: The idle time in minutes.

Lasterror is set.

HASPHLDMBS.LegacySetRTC(time as memoryblock)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 11.1 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Writes to HASP4-compatible real-time clock.

This object must have been created by calling Constructor() with a "prognum" Feature ID.

This request is only supported on locally accessed keys. Attempting to set the time on a remotely accessed key will return HASP_NO_TIME.

time: The new time value (8 byte Memoryblock)

Lasterror is set.

HASPHLDMBS.ReadMemory(FileID as Integer, Offset as Integer, Size as Integer) as Memoryblock

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 11.1 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Reads the memory of a Sentinel HASP protection key.

Valid File IDs are HASP_FILEID_RW and HASP_FILEID_RO.

Legacy HASP Remarks
Valid File IDs are HASP_FILEID_LICENSE and HASP_FILEID_MAIN.

FileID: Identifier for the file that is to be read
Offset: Byte offset in the file
Size: Number of bytes to read.

Lasterror is set.

HASPHLDMBS.ReadString(FileID as Integer, Offset as Integer, Size as Integer) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 11.1 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Reads the memory of a Sentinel HASP protection key.

Valid File IDs are HASP_FILEID_RW and HASP_FILEID_RO.

Legacy HASP Remarks
Valid File IDs are HASP_FILEID_LICENSE and HASP_FILEID_MAIN.

FileID: Identifier for the file that is to be read
Offset: Byte offset in the file
Size: Number of bytes to read.

Lasterror is set.

HASPHLDMBS.Update(data as string) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 11.1 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Updates a Sentinel HASP protection key.

This function writes update information. Note that the Sentinel HASP protection key must be locally connected.

The update code contains all necessary data to perform the update on a deployed Sentinel HASP protection key including:

  • The Sentinel HASP protection key on which the updated information is to be written
  • The necessary Vendor Code that is required to access the Sentinel HASP key
  • The actual update information

Depending on the update data, the function returns an acknowledgement code that is signed/encrypted by the key. The code is evidence that an update has been applied to a license.

data: The update data.
Returns the acknowledge data.

Lasterror is set.

HASPHLDMBS.WriteMemory(FileID as Integer, FileOffset as Integer, Data as Memoryblock, DataOffset as Integer, Size as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 11.1 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Writes to the memory of a Sentinel HASP protection key.

Valid File ID is HASP_FILEID_RW.

Depending on the provided session handle (either logged into the default Feature or any other Feature), write access to the FAS memory (HASP_FILEID_LICENSE) is not permitted.

FileID: Identifier for the file that is to be written
FileOffset: Byte offset in the file
Data: the data
DataOffset: Start address in Bytes in the memoryblock.
Size: Data size in Bytes in memoryblock.

Lasterror is set.

HASPHLDMBS.WriteString(FileID as Integer, FileOffset as Integer, Data as String)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 11.1 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Writes to the memory of a Sentinel HASP protection key.

alid File ID is HASP_FILEID_RW.

Depending on the provided session handle (either logged into the default Feature or any other Feature), write access to the FAS memory (HASP_FILEID_LICENSE) is not permitted.

FileID: Identifier for the file that is to be written
FileOffset: Byte offset in the file
Data: the data

Lasterror is set.

The items on this page are in the following plugins: MBS Dongle Plugin.


The biggest plugin in space...