write Method
Package: Aladdin
Description
Writes to the memory of a Sentinel protection key.
Syntax
boolean Aladdin.Hasp.write ( long fileid,
int offset,
int length,
byte[] buffer
)
Parameters
|
|
Identifier for the file to write. Possible values are: >For default read/write memory: HASP_FILEID_RW >For a dynamic memory file (read/write or read/write-once): The ID that was assigned to the file when the file was created. The ID is a value from 1 through 65471. NOTE Dynamic memory files are supported by Sentinel SL keys and Sentinel HL (Driverless configuration) keys (excluding HL Basic and HL Pro keys). |
|
|
Byte offset in the file |
|
|
Number of bytes to be written to the file |
|
|
Pointer to the data that is written |
Return Values
true/false - indicates success or failure.
Usage Notes
When this method is called, a write cycle is performed for the Sentinel protection key. Sentinel HL keys are certified to withstand a specific number of write cycles. For information on the number of write cycles for which Sentinel HL keys are certified, see the Sentinel HL Data Sheet.
NOTE To defeat a protection key emulator attempting to bypass software protection, you can check periodically that the protection key is available and that a session for the key exists. This should not be done using GetSessionInfo (this method does not detect a remote broken session). Instead, use one of the following methods: Encrypt, Decrypt, Read, Write. These methods will return HASP_BROKEN_SESSION if a session for the protection key does not exist.
High-Availability Memory Write Restriction
In high-availability configurations, write operations to protection key memory using hasp_write() are actively blocked by the Sentinel Licensing API.
When an application attempts to write data to any dynamic memory segment of a high-availability protection key, the API rejects the request and returns status code 121 (HASP_HA_WRITE_NOT_ALLOWED).
NOTE Pre-populated Read/Write and Write-Once memory files can still be created and deployed in high-availability products using Sentinel EMS. Applications can read this memory data without restriction using hasp_read(). For memory access boundaries and licensing rules, see the
Overloaded Methods
The following overloaded methods are provided. They differ from the method above only in the arguments that they accept.
boolean Aladdin.Hasp.write ( long fileid,
int offset,
byte[] value
)
