Platforms to show: All Mac Windows Linux Cross-Platform

Back to HASPHLMBS class.

HASPHLMBS.Close
Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 6.1 ✅ Yes ✅ Yes ❌ No ❌ No Desktop, Console & Web
Function: The destructor.
Notes:
If you logged in successful before, it logs out from a session and frees all allocated resources for the session.
Lasterror is set.
HASPHLMBS.Constructor(FeatureID as Integer, VendorCode as string)
Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 6.1 ✅ Yes ✅ Yes ❌ No ❌ No Desktop, Console & Web
Function: Login into a feature.
Notes:
This function establishes a context (logs into a feature).

feature_id: Unique identifier of the feature. Combinations of constants below.
vendor_code: string with the vendor code

For local prognum features, concurrency is not handled and each login performs a decrement if it is a counting license.

Network prognum features just use the old HASPLM login logic with all drawbacks.
There is only support for concurrent usage of \b one server (global server address).

Lasterror is set.

const HASP_PROGNUM_OPT_NO_LOCAL =&h00008000Disable local license search
const HASP_PROGNUM_OPT_NO_REMOTE =&h00004000Disable network license search
const HASP_PROGNUM_OPT_PROCESS =&h00002000Sets session count of network licenses to per-process
const HASP_PROGNUM_OPT_CLASSIC =&h00001000Enables the API to access "classic" (HASP4 or earlier) keys
const HASP_PROGNUM_OPT_TS =&h00000800Presence of Terminal Services gets ignored
HASPHLMBS.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 6.1 ✅ Yes ✅ Yes ❌ No ❌ No Desktop, Console & Web
Function: Convert broken up time into a time type.
Notes:
Lasterror is set.
Times are in UTC.
HASPHLMBS.DecryptMemory(Data as Memoryblock, DataOffset as Integer, Size as Integer)
Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 6.1 ✅ Yes ✅ Yes ❌ No ❌ No Desktop, Console & Web
Function: This function decrypts a buffer.
Notes:
This is the reverse operation of the hasp_encrypt() function.
Lasterror is set.

Data: Buffer
DataOffset: Start offset in the buffer.
Size: size in bytes of the buffer to be decrypted (16 bytes minimum)

If the decryption fails (e.g. key removed in-between) the data pointed to by buffer is unmodified.
HASPHLMBS.DecryptString(Data as string) as string
Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 6.1 ✅ Yes ✅ Yes ❌ No ❌ No Desktop, Console & Web
Function: This function decrypts a buffer.
Notes:
This is the reverse operation of the hasp_encrypt() function.
This function encrypts a buffer.
Lasterror is set.

If the decryption fails (e.g. key removed in-between) an empty string is returned.
HASPHLMBS.EncryptMemory(Data as Memoryblock, DataOffset as Integer, Size as Integer)
Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 6.1 ✅ Yes ✅ Yes ❌ No ❌ No Desktop, Console & Web
Function: Encrypt a buffer.
Example:
dim h as HASPHLMBS // your hasp object
dim mem as MemoryBlock // your data

h.EncryptMemory(mem,0,mem.size) // Whole block
Notes:
This function encrypts a buffer.
Lasterror is set.

Data: Buffer
DataOffset: Start offset in the buffer.
Size: size in bytes of the buffer to be encrypted (16 bytes minimum)

If the encryption fails (e.g. key removed in-between) the data pointed to by buffer is unmodified.
HASPHLMBS.EncryptString(Data as string) as string
Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 6.1 ✅ Yes ✅ Yes ❌ No ❌ No Desktop, Console & Web
Function: Encrypt a buffer.
Notes:
This function encrypts a buffer.
Lasterror is set.

If the encryption fails (e.g. key removed in-between) an empty string is returned.
HASPHLMBS.GetRTC as memoryblock
Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 6.1 ✅ Yes ✅ Yes ❌ No ❌ No Desktop, Console & Web
Function: Read current time from a time key.
Notes:
This function reads the current time from a time key.
The time will be returned in seconds since Jan-01-1970 0:00:00 GMT.

The general purpose of this function is not related to licensing, but to get reliable timestamps which are independent from the system clock.
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 a 64bit integer inside an eight byte memoryblock.
HASPHLMBS.GetSessionInfo(format as string) as string
Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 6.1 ✅ Yes ✅ Yes ❌ No ❌ No Desktop, Console & Web
Function: Get information in a session context.
Notes:
format: XML definition of the output data structure

const HASP_UPDATEINFO= <haspformat format="updateinfo"/>hasp_get_sessioninfo() format to get update info (C2V)
const HASP_SESSIONINFO= <haspformat format="sessioninfo"/>hasp_get_sessioninfo() format to get session info
const HASP_KEYINFO= <haspformat format="keyinfo"/>hasp_get_sessioninfo() format to get key/hardware info

Returns XML data with the requested information.

Calling GetSessionInfo with HASP_UPDATEINFO format will return something like this:

<?xml version="1.0" encoding="UTF-8"?>
<hasp_info>
<c2v>
YYIBlIADY3R2oQaABEAwulCiCYABaoEBBIIBAKOBxoABAIGBwD2sfFj8UKuDvNWH9
LhfRKDzUbLCAi6E9mN8ea7EclwOl9VeLMDuLvfsEvkor2igmwxg/wWs6HCuypEFi6
V/FkI4EUmQNmcKSIY302s9CzHP7aCrG7QKvzArVq25Nc7UxIQJ4kZJm1oWiw3zZJq
UY+G0EleETkPZ8n2uDfMauBpdWhW0R35rHlRM4wiYCZzaelpRtDX36HDh1caqfpaL
mUnwWXRz0+tLs+Dvd+kLmvcQ6jWJJb4r2rxywG2IW1WTjIWBsI+h0/UgaIhG1J+9R
EQ1SrMx3YQ2bpdlK3FluZVDayW9okv7idxKJS4zGG+4UOccpKT4aWJi9cR0vdm4s/
J6fUNbhK522x/gdvR51a6ll46GpVn2HjD0ZpAgCeu6xAIwHJ7Kc6tjeRfxYX9YksE
aB9JoV/uaPTHnbu2AgQmd0r09p0zmXgD4Kuk8EtTs1GoBbY7WF3qHJsj1Iz1ZeAdA
rdNOYKsOgA/q1tuLLR7O0dag
</c2v>
</hasp_info>

Calling GetSessionInfo with HASP_SESSIONINFO format will return something like this:

<hasp_info>
<feature>
<featureid>4294905856</featureid>
<maxlogins>5</maxlogins>
<currentlogins>1</currentlogins>
<activations>unlimited</activations>
</feature>
</hasp_info>

In case of a expiring license on a time enabled key (prognum <= 8), instead of the remaining activations the expiration date will be returned:

<hasp_info>
<feature>
<featureid>4294905857</featureid>
<expirationdate>1052919239</expirationdate>
</feature>
</hasp_info>

For locally accessed keys there is no maxlogins and currentlogins field.

Calling GetSessionInfo with HASP_KEYINFO format will return something like this for a locally accessed key:

<?xml version="1.0" encoding="UTF-8"?>
<hasp_info>
<keyspec>
<keycaps>
<hasp4/>
<aes/>
<newintf/>
</keycaps>
<hasp>
<haspid>12345</haspid>
<nethasptype>0</nethasptype>
<memoryinfo>
<name>"Main"</name>
<fileid>65520</fileid>
<size>48</size>
</memoryinfo>
<memoryinfo>
<name>"FAS"</name>
<fileid>65522</fileid>
<size>80</size>
</memoryinfo>
</hasp>
<port>
<type>"USB"</type>
<address>1</address>
</port>
</keyspec>
</hasp_info>

Calling GetSessionInfo with HASP_KEYINFO format will return something like this for a remotely accessed key:

<?xml version="1.0" encoding="UTF-8"?>
<hasp_info>
<keyspec>
<keycaps>
<hasp4/>
</keycaps>
<hasp>
<haspid>782062012</haspid>
<nethasptype>5</nethasptype>
<memoryinfo>
<name>"Main"</name>
<fileid>65520</fileid>
<size>432</size>
</memoryinfo>
<memoryinfo>
<name>"FAS"</name>
<fileid>65522</fileid>
<size>448</size>
</memoryinfo>
</hasp>
<serveraddress>
<protocol>"IP"</protocol>
<address>"10.20.3.10"</address>
</serveraddress>
</keyspec>
</hasp_info>

keycaps flags:
hasp4support HASP4 compatible encryption
aessupport AES encryption
rtckey has real time clock chip
newintfsupports new access interface
HASPHLMBS.GetSize(FileID as Integer) as Integer
Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 6.1 ✅ Yes ✅ Yes ❌ No ❌ No Desktop, Console & Web
Function: Get memory size.
Notes:
This function is used to determine the memory size.
Returns the number of bytes inside the file.
Lasterror is set.

const HASP_FILEID_MAIN= &hfff0File id for HASP4 compatible memory contents w/o FAS
const HASP_FILEID_LICENSE = &hfff2(Dummy) file id for license data area of memory contents
HASPHLMBS.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 6.1 ✅ Yes ✅ Yes ❌ No ❌ No Desktop, Console & Web
Function: Convert time type into broken up time
Notes:
Lasterror is set.
Times are in UTC.
HASPHLMBS.LegacyDecryptMemory(Data as Memoryblock, DataOffset as Integer, Size as Integer)
Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 6.1 ✅ Yes ✅ Yes ❌ No ❌ No Desktop, Console & Web
Function: This function decrypts a buffer.
Notes:
This is the reverse operation of the hasp_encrypt() function.
Lasterror is set.

Data: Buffer
DataOffset: Start offset in the buffer.
Size: size in bytes of the buffer to be decrypted (16 bytes minimum)

If the decryption fails (e.g. key removed in-between) the data pointed to by buffer is unmodified.

Legacy HASP functionality for backward compatibility.
HASPHLMBS.LegacyDecryptString(Data as string) as string
Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 6.1 ✅ Yes ✅ Yes ❌ No ❌ No Desktop, Console & Web
Function: This function decrypts a buffer.
Notes:
This is the reverse operation of the hasp_encrypt() function.
This function encrypts a buffer.
Lasterror is set.

If the decryption fails (e.g. key removed in-between) an empty string is returned.

Legacy HASP functionality for backward compatibility.
HASPHLMBS.LegacyEncryptMemory(Data as Memoryblock, DataOffset as Integer, Size as Integer)
Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 6.1 ✅ Yes ✅ Yes ❌ No ❌ No Desktop, Console & Web
Function: Encrypt a buffer.
Example:
dim h as HASPHLMBS // your hasp object
dim mem as MemoryBlock // your data

h.LegacyEncryptMemory(mem,0,mem.size) // Whole block
Notes:
This function encrypts a buffer.
Lasterror is set.

Data: Buffer
DataOffset: Start offset in the buffer.
Size: size in bytes of the buffer to be encrypted (16 bytes minimum)

If the encryption fails (e.g. key removed in-between) the data pointed to by buffer is unmodified.

Legacy HASP functionality for backward compatibility.
HASPHLMBS.LegacyEncryptString(Data as string) as string
Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 6.1 ✅ Yes ✅ Yes ❌ No ❌ No Desktop, Console & Web
Function: Encrypt a buffer.
Notes:
This function encrypts a buffer.
Lasterror is set.

If the encryption fails (e.g. key removed in-between) an empty string is returned.

Legacy HASP functionality for backward compatibility.
HASPHLMBS.LegacySetIdleTime(idletime as Integer)
Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 6.1 ✅ Yes ✅ Yes ❌ No ❌ No Desktop, Console & Web
Function: Set the LM idle time.
Notes:
idletime: the idle time in minutes

Legacy HASP functionality for backward compatibility.
HASPHLMBS.LegacySetRTC(time as memoryblock)
Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 6.1 ✅ Yes ✅ Yes ❌ No ❌ No Desktop, Console & Web
Function: Write to HASP4 compatible real time clock
Notes:
This request is only supported on locally accessed keys. Trying to set the time on a remotely accessed key will return HASP_NO_TIME.

Legacy HASP functionality for backward compatibility.
HASPHLMBS.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 6.1 ✅ Yes ✅ Yes ❌ No ❌ No Desktop, Console & Web
Function: This function is used to read from the key memory.
Notes:
Lasterror is set.
Offset: Byte start in the file.
Size: Number of bytes in the file.
Result: The data read from the file.

const HASP_FILEID_MAIN= &hfff0File id for HASP4 compatible memory contents w/o FAS
const HASP_FILEID_LICENSE = &hfff2(Dummy) file id for license data area of memory contents
HASPHLMBS.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 6.1 ✅ Yes ✅ Yes ❌ No ❌ No Desktop, Console & Web
Function: This function is used to read from the key memory.
Notes:
Lasterror is set.
Offset: Byte start in the file.
Size: Number of bytes in the file.
Result: The data read from the file.

const HASP_FILEID_MAIN= &hfff0File id for HASP4 compatible memory contents w/o FAS
const HASP_FILEID_LICENSE = &hfff2(Dummy) file id for license data area of memory contents
HASPHLMBS.Update(data as string) as string
Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 6.1 ✅ Yes ✅ Yes ❌ No ❌ No Desktop, Console & Web
Function: Write an update.
Notes:
This function writes update information. The update blob contains all necessary data to perform the update: Where to write (in which "container", e.g. dongle), the necessary access data (vendor code) and of course the update itself.
If the update blob requested it, the function returns in an acknowledge blob, which is signed/encrypted by the updated instance and contains a proof that this update was successfully installed.

data: string with the complete update data.

Update via LM is not supported.

Lasterror is set.
HASPHLMBS.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 6.1 ✅ Yes ✅ Yes ❌ No ❌ No Desktop, Console & Web
Function: Write to key memory.
Notes:
Lasterror is set.
FileOffset: Byte start in the file.
Data: The data to be written to the file.
DataOffset: The byte offset inside the memoryblock.
Size: The number of bytes to be written.

const HASP_FILEID_MAIN= &hfff0File id for HASP4 compatible memory contents w/o FAS
const HASP_FILEID_LICENSE = &hfff2(Dummy) file id for license data area of memory contents
HASPHLMBS.WriteString(FileID as Integer, FileOffset as Integer, Data as String)
Type Topic Plugin Version macOS Windows Linux iOS Targets
method Dongle MBS Dongle Plugin 6.1 ✅ Yes ✅ Yes ❌ No ❌ No Desktop, Console & Web
Function: Write to key memory.
Notes:
Lasterror is set.
FileOffset: Byte start in the file.
Data: The data to be written to the file.

const HASP_FILEID_MAIN= &hfff0File id for HASP4 compatible memory contents w/o FAS
const HASP_FILEID_LICENSE = &hfff2(Dummy) file id for license data area of memory contents

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


💬 Ask a question or report a problem
The biggest plugin in space...