|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectAladdin.Hasp
public class Hasp
| Field Summary | |
|---|---|
static long |
HASP_DEFAULT_FID
HASP default Feature ID. |
static long |
HASP_FEATURETYPE_MASK
AND-mask used to identify the Feature type. |
static long |
HASP_FILEID_LICENSE
HASP4 FAS memory file: (Dummy) File ID for license data segment of memory contents. |
static int |
HASP_FILEID_MAIN
HASP4 memory file: File ID for HASP4-compatible memory contents without FAS. |
static long |
HASP_FILEID_RO
File ID for HASP secure read only memory. |
static long |
HASP_FILEID_RW
File ID for HASP secure writable memory. |
static java.lang.String |
HASP_KEYINFO
getSessionInfo() format to retrieve key/hardware info. |
static int |
HASP_MIN_BLOCK_SIZE
Minimal block size for hasp_encrypt() and hasp_decrypt() functions. |
static long |
HASP_MIN_BLOCK_SIZE_LEGACY
Minimal block size for legacy functions hasp_legacy_encrypt() and hasp_legacy_decrypt(). |
static long |
HASP_PROGNUM_DEFAULT_FID
"Prognum" default Feature ID. |
static long |
HASP_PROGNUM_FEATURETYPE
After AND-ing with HASP_FEATURETYPE_MASK, the Feature type contains this value. |
static long |
HASP_PROGNUM_MASK
AND-mask used to extract program number from Feature ID if program number Feature. |
static long |
HASP_PROGNUM_OPT_CLASSIC
"Prognum" option: enables the API to access "classic" (HASP4 or earlier) keys. |
static long |
HASP_PROGNUM_OPT_MASK
AND-mask used to identify "prognum" options. |
static long |
HASP_PROGNUM_OPT_NO_LOCAL
"Prognum" option: disables local license search. |
static long |
HASP_PROGNUM_OPT_NO_REMOTE
"Prognum" option: disables network license search. |
static long |
HASP_PROGNUM_OPT_PROCESS
"Prognum" option: sets session count of network licenses to "per process". |
static long |
HASP_PROGNUM_OPT_TS
"Prognum" option: ignores Terminal Services. |
static java.lang.String |
HASP_SESSIONINFO
getSessionInfo() format to retrieve session info. |
static java.lang.String |
HASP_UPDATEINFO
getSessionInfo() format to retrieve update info (C2V). |
| Constructor Summary | |
|---|---|
Hasp(long feature_id)
Hasp constructor. |
|
| Method Summary | |
|---|---|
boolean |
decrypt(byte[] buffer,
int length)
Decrypts a buffer. |
boolean |
encrypt(byte[] buffer,
int length)
Encrypts a buffer. |
java.lang.String |
getInfo(java.lang.String scope,
java.lang.String format,
java.lang.String vendor_code)
Retrieves information about all system components. |
int |
getLastError()
Returns the error that occurred in the last function call. |
HaspTime |
getRealTimeClock()
Reads the current time from a HASP Time key. |
java.lang.String |
getSessionInfo(java.lang.String format)
Retrieves information regarding a session context. |
int |
getSize(long fileid)
Retrieves the byte size of a memory file from a HASP key. |
HaspApiVersion |
getVersion(java.lang.String vendor_code)
Reads the HASP API Version. |
boolean |
login(java.lang.String vendor_code)
Logs in to a Feature. |
boolean |
loginScope(java.lang.String scope,
java.lang.String vendor_code)
Logs in to a Feature according to customizable search parameters. |
boolean |
logout()
Logs out from a session and frees all allocated resources for the session. |
boolean |
read(long fileid,
int offset,
int length,
byte[] buffer)
Reads from the HASP key memory. |
java.lang.String |
update(java.lang.String update_data)
Writes update information to a HASP key. |
boolean |
write(long fileid,
int offset,
int length,
byte[] buffer)
Writes to the HASP key memory. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String HASP_UPDATEINFO
public static final java.lang.String HASP_SESSIONINFO
public static final java.lang.String HASP_KEYINFO
public static final long HASP_FEATURETYPE_MASK
public static final long HASP_PROGNUM_FEATURETYPE
public static final long HASP_PROGNUM_MASK
public static final long HASP_PROGNUM_OPT_MASK
public static final long HASP_PROGNUM_OPT_NO_LOCAL
public static final long HASP_PROGNUM_OPT_NO_REMOTE
public static final long HASP_PROGNUM_OPT_PROCESS
public static final long HASP_PROGNUM_OPT_CLASSIC
public static final long HASP_PROGNUM_OPT_TS
public static final long HASP_DEFAULT_FID
public static final long HASP_PROGNUM_DEFAULT_FID
public static final int HASP_MIN_BLOCK_SIZE
public static final long HASP_MIN_BLOCK_SIZE_LEGACY
public static final int HASP_FILEID_MAIN
public static final long HASP_FILEID_LICENSE
public static final long HASP_FILEID_RW
public static final long HASP_FILEID_RO
| Constructor Detail |
|---|
public Hasp(long feature_id)
Network "prognum" Features only use the old HASP LM login logic, with all its limitations.
Only concurrent usage of one server is supported (global server address).
feature_id - Unique identifier of the Feature.
With "prognum" Features (see HASP_FEATURETYPE_MASK),
8 bits are reserved for legacy options (see
HASP_PROGNUM_OPT_MASK, currently 5 bits are used):
| Method Detail |
|---|
public int getLastError()
public boolean login(java.lang.String vendor_code)
vendor_code - The Vendor Code.
loginScope(java.lang.String, java.lang.String),
logout(),
getLastError()
public boolean loginScope(java.lang.String scope,
java.lang.String vendor_code)
scope - The hasp_scope of the Feature search.vendor_code - The Vendor Code.
login(java.lang.String),
logout(),
getLastError()public boolean logout()
login(java.lang.String),
getLastError()
public boolean encrypt(byte[] buffer,
int length)
If the encryption fails (e.g. key removed during the process) the data buffer is unmodified.
buffer - The buffer to be encrypted.length - Size in bytes of the buffer to be encrypted (16 bytes minimum).
decrypt(byte[], int),
getLastError()
public boolean decrypt(byte[] buffer,
int length)
If the decryption fails (e.g. key removed during the process) the data buffer is unmodified.
buffer - The buffer to be decrypted.length - Size in bytes of the buffer to be decrypted (16 bytes minimum).
encrypt(byte[], int),
getLastError()
public java.lang.String getInfo(java.lang.String scope,
java.lang.String format,
java.lang.String vendor_code)
This function is not used in a login context, so it can be used in a generic "Monitor" application.
scope - XML definition of the information scope.format - XML definition of the output data structure.vendor_code - The Vendor Code.
getSessionInfo(java.lang.String),
getLastError()public java.lang.String getSessionInfo(java.lang.String format)
format - XML definition of the output data structure.
getLastError()
public boolean read(long fileid,
int offset,
int length,
byte[] buffer)
fileid - ID of the file to read (memory descriptor).offset - Position in the file.length - Number of bytes to be read from the file.buffer - The retrieved data.
getLastError(),
write(long, int, int, byte[]),
getSize(long)
public boolean write(long fileid,
int offset,
int length,
byte[] buffer)
fileid - ID of the file to write (memory descriptor).offset - Position in the file.length - Number of bytes to write to the file.buffer - The data to write.
getLastError(),
read(long, int, int, byte[]),
getSize(long)public int getSize(long fileid)
fileid - ID of the file to be queried.
getLastError(),
read(long, int, int, byte[]),
write(long, int, int, byte[])public java.lang.String update(java.lang.String update_data)
If requested by the update BLOB, the function returns an Acknowledge BLOB, which is signed/encrypted by the updated instance and contains proof that this update was successfully installed.
update_data - The complete update data.
getLastError()public HaspTime getRealTimeClock()
The general purpose of this function is to obtain reliable timestamps that are independent from the system clock.
public HaspApiVersion getVersion(java.lang.String vendor_code)
vendor_code - The Vendor Code.
getLastError()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||