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

fileid

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).

offset

Byte offset in the file

length

Number of bytes to be written to the file

buffer

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.

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
                           )

Related Topics

GetLastError Method

GetSize Method

Read Method