CmProgram
Description
CmProgram programs entries into a CmDongle. The programming can be one of the following tasks:
•Adding a new Firm Item.
•Updating an existing Firm Item.
•Deleting an existing Firm Item.
•Adding a new Product Item to an existing Firm Item.
•Updating an existing Product Item.
•Deleting an existing Product Item.
•Setting a new value in the Box Control register of a CmDongle.
•(Un-)Locking a CmDongle.
•Programming a new Firm Key into a FSB entry.
•Programming a new Userkey into a CmDongle.
|
Triple Mode Redundancy-related information (TMR)
|
Syntax
int CMAPIENTRY CmProgram(HCMSysEntry hcmse, CMULONG flCtrl, void *pvCtrl, CMUINT cbCtrl, void *pvVerify, CMUINT cbVerify)
Parameter
hcmse contains a handle opened by CmAccess / . The access mode can be Box Access, Firm Item Access or Entry Access. The required access mode depends on the operation set in flCtrl. The handle is connected to a CmLocal or a CmLAN subsystem with a connected CmDongle. This CmDongle will be used for programming.
flCtrl contains one of the following commands:
CM_GF_ADD_FIRMITEM adds a Firm Item into a CmDongle. pvCtrl is pointing to a
CMPROGRAM_ADD_FIRMITEM structure. hcmse must be Box Access.
Structure CMPROGRAM_ADD_FIRMITEM CMPROGRAM_ADD_FIRMITEM contains all needed information to add a Firm Item to a CmDongle. The following parameters of the structure are encrypted: musFirm ItemTypeEncrypted to mabSessionId (inclusive). This member defines a sequence of 64 bytes which are encrypted by AES-CBC. The key and the CBC initialization vector depends on the addressed Firm Code and of parameters of the addressed CmDongle. Syntax
Parameter musFirmItemReference contains the reserved Firm Item Reference received with CmReserveFirmItem(). musFirmItemTypePlain specifies the type of the Firm Item. The following flags can be set:
mabPublicLicensorKey contains 64 bytes of ECC Licensor Key which is required to decrypt the specified data via the private Box Key, Serial Key, Firm Common Key and Serial Number of the addressed CmDongle. musFirmItemTypeEncrypted (encrypted) specifies the type of the Firm Item. The following flags can be set:
This value must be equal to musFirmItemTypePlain! musFirmAccessCounter (encrypted) contains the initial value of the Firm Access Counter. If this member is set to 0xFFFF (the recommended value), this counter is not decremented by an encryption which targets this counter. mulFirmUpdateCounter (encrypted) contains the initial value of the Firm Update Counter. The recommended value is 0. mulFirmPreciseTime (encrypted) contains the new Firm Precise Time in seconds since 1st January 2000, 0:00:00. If the value is not used, 0 must be specified, which sets this field to the Running Box Clock value. mulReserved (encrypted) should be set to 0. Reserved for future purposes. mabFirmKey (encrypted) contains the secret Firm Key, which has a fixed length of 32 bytes. mabSessionId (encrypted) contains the Session ID received with CmReserveFirmItem(). mcchText contains the initial length of the Firm Item Text of the Firm Item to program. mausText contains the initial Firm Item Text of the Firm Item to program.
|
CM_GF_UPDATE_FIRMITEM updates a Firm Item in a CmDongle. pvCtrl is pointing to a
CMPROGRAM_UPDATE_FIRMITEM structure. hcmse must be Firm Item Access or Entry Access.
CM_GF_DELETE_FIRMITEM deletes a Firm Item in a CmDongle. pvCtrl is pointing to a
CMPROGRAM_DELETE_FIRMITEM structure. hcmse must be Firm Item Access or Entry Access.
Structure CMPROGRAM_DELETE_FIRMITEM CMPROGRAM_DELETE_FIRMITEM contains all parameters needed for deleting a complete Firm Item. Syntax
Parameter musFirmItemReference contains the Reference of the Firm Item which has to be removed. mabTrailingValidationBlock contains a 16-byte TVB (Trailing Validation Block), which must be valid to execute the operation. This TVB is ignored, if the addressed Firm Item was directly created with CmReserveFirmItem().
|
CM_GF_ADD_PRODUCTITEM adds a Product Item into a CmDongle. pvCtrl is pointing to a
CMPROGRAM_ADD_PRODUCTITEM structure. hcmse must be Entry Access.
Structure CMPROGRAM_ADD_PRODUCTITEM CMPROGRAM_ADD_PRODUCTITEM contains all needed information to add a Product Item to a CmDongle. All parameters are encrypted. Syntax
Parameter musFirmItemReference (encrypted) contains the Reference of the Firm Item for which the Product Item is to be added. If this is 1, the IFI (Implicit Firm Item) is used. The addressed item must not have set the type. 0 is either not permitted. musProductItemSuccessorReference (encrypted) contains the Reference of the Product Item, which will be the successor of the newly added Product Item. If this value is 0, the Product Item is created at the end of the Product Item list. If musFirmItemReference specifies 0 for the IFI, the Product Item may be individually addressed by setting 2 for User Product Item (UPI). 1 for the Common Product Item (CPI) is not permitted because this must be always the first Product Item of the IFI. mabProductItemOptionBuffer (encrypted) contains a byte sequence of variable length which specifies the added Product Code and all further Product Item Options. The sequence is defined by one or more subsequent CMCPIO_... structures. The parameter is filled with CmCreateProductItemOption() and finalized with CmCreateSequence(). The complete list is encrypted by AES-CBC. Finally, a 16-bytes TVB (Trailing Validation Block) is added, which is the encrypted SHA-256 hash of the preceding padded byte sequence.
|
CM_GF_UPDATE_PRODUCTITEM updates a Product Item in a CmDongle. pvCtrl is pointing to a
CMPROGRAM_UPDATE_PRODUCTITEM structure. hcmse must be Entry Access.
|
CM_GF_DELETE_PRODUCTITEM deletes a Product Item in a CmDongle. pvCtrl is pointing to a
CMPROGRAM_DELETE_PRODUCTITEM structure. hcmse must be Entry Access.
|
CM_GF_SET_BOXCONTROL sets the control flag of the CmDongle. pvCtrl is pointing to a
CMPROGRAM_BOXCONTROL structure.
Structure CMPROGRAM_BOXCONTROL CMPROGRAM_BOXCONTROL contains the parameters to program the CmDongle control registers. Syntax
Parameter mflCtrl specifies the kind of the programming of the CmDongle control registers.
musIndicatorFlags contains the two bytes to program or switch. musReserve is reserved for future purposes.
|
CM_GF_SET_FIRMKEY programs a Firm Key into an already programmed FSB entry in a CmDongle. pvCtrl is pointing to a 32 element byte array. hcmse must be Entry Access.
CM_GF_ADD_ENABLEBLOCK adds a new Enable Block Item to a Firm Item. The input parameters are stored in a
CMENABLING_WRITEADD structure. The return value of the function is the index of the created Enable Block Item in the Enable Block Table. If no Enable Block Item is created, then 0 is returned and an error code is set.
|
CM_GF_UPDATE_ENABLEBLOCK updates the content of an existing Enable Block Item. The input parameters are stored in a byte array (pointer to unsigned char). The return value for this flag is 1 (TRUE), if no error occurred, else 0 (FALSE).
CM_GF_DELETE_ENABLEBLOCK deletes an existing Enable Block Item in a Firm Item. The input parameters are stored in a
CMENABLING_WRITEDELETE structure. The return value for this flag is 1 (TRUE), if no error occurred, else 0 (FALSE).
Structure CMENABLING_WRITEDELETE CMENABLING_WRITEDELETE describes the request sequence for deleting a Enable Block Item (EBI). command. Syntax
Parameter musFirmItemReference contains the reference of the Firm Item which defines the Enabling Block. If this is 0, the IFI (Implicit Firm Item) is used. mbEnableBlockIndex contains the index of the Enabling Block which is deleted. This must be a value between 0 and 30. mabTrailingValidationBlock contains the Trailing Validation Block (TVB), which checks whether the delete operation is valid. This is an AES encryption of the SHA-256 hash of the preceding bytes.
|
CM_GF_ATTACH_ENABLEBLOCK attaches an existing Enable Block Item to a Firm Item or Product Item. The input parameters are stored in a
CMENABLING_WRITEATTACHDETACH structure. The return value for this flag is 1 (TRUE), if if no error occurred, else 0 (FALSE).
Structure CMENABLING_WRITEATTACHDETACH CMENABLING_WRITEATTACHDETACH describes the request sequence for attaching or detaching a Enable Block Item (EBI). Syntax
Parameter mbEnableBlockIndex contains the index of the Enabling Block Item which is attached. The subsequent bytes are encrypted by AES-CBC or Triple-DES-CBC. They have a fixed length of 32 bytes. musFirmItemReference contains the reference of the Firm Item in which the Enabling Block is attached. If this is 0, the IFI (Implicit Firm Item) is used. musProductItemReference contains the Reference of the Product Item in which the Enabling Block is attached. If the Enabling Block should be attached to the Firm Item, this member must be set to 0. If musFirmItemReference specifies 0, the Product Item may be individually addressed by setting Common Product Item (CPI) or User product item (UPI). mulFirmUpdateCounter contains the current value of the Firm Update Counter of the Firm Item which owns the Enabling Block. mcmEnableLookupEntry contains the Enabling Lookup Entry which defines the attachment. If the mbEnableLevel member is set to CM_ELUE_DETACH, the Enabling Lookup Entry is deleted. mabTrailingValidationBlock contains the TVB (Trailing Validation Block), which contains the current hash sequence (16 bytes) to validate that the sequence is correctly encrypted. Notes All parameters set by the user to this structure must be set in Little Endian format! Normally this must be noticed on Big Endian CPU's like the Apple Macintosh. On PC's (x86) the parameters (16 & 32 Bit) are stored in Little Endian so that the user has nothing to mentioned (Little/Big Endian).
|
CM_GF_DETACH_ENABLEBLOCK detaches an existing Enable Block Item from a Firm Item or Product Item. The input parameters are stored in a CMENABLING_WRITEATTACHDETACH structure. The return value for this flag is 1 (TRUE), if no error occurred, else 0 (FALSE).
CM_GF_ENABLEITEM enables the Enabling Block Item defined in
CMENABLING_CONTEXT
|
CM_GF_DISABLEITEM disables the Enabling Block Item defined in CMENABLING_CONTEXT.
CM_GF_TEMPENABLEITEM enables temporarily the Enabling Block Item defined in CMENABLING_CONTEXT.
CM_GF_SET_BOXPASSWORD2 passes the CmDongle password in (UTF-8 character set) to the CodeMeter Runtime Server. If the CmDongle Password is passed using this option, no dialog will be opened to ask the user for the personal CmDongle password. The specified passsword must be 0 terminated.
CM_GF_CHANGE_BOXPASSWORD changes the CmDongle Password (UTF-8 character set) in a CmDongle. The input parameters (old and new password) are stored in a
CMPROGRAM_BOXPASSWORD structure.
Structure CMPROGRAM_BOXPASSWORD CMPROGRAM_BOXPASSWORD contains all parameters needed for changing a CmContainer Password. Syntax
Parameter mszOldPassword contains the string of the old CmContainer Password. mszNewPassword contains the string of the new CmContainer Password.
|
CM_GF_RESET_BOXPASSWORD resets the cached CmDongle Password.
Additional flags:
CM_PROG_DEFRAGMEM can be or'ed. This flag cleans up the memory of the CmDongle after the programming step has been performed.
CM_PROG_MASTERPASSWORD can be or'ed. This flag will use a master password to set the new box password.
Note that all hyphens of the master password must be removed and all letters must be set in lower case.
pvCtrl contains a structure depending on the flCtrl flag (see above).
cbCtrl contains the number of bytes of the pvCtrl byte buffer/structure.
pvVerify contains a byte buffer receiving the verification sequence for the programmer. Except of the CM_GF_DELETE_FIRMITEM command this is a signed list command of the added/updated/deleted Firm Item (Signed List of the whole Firm Item). CM_GF_DELETE_FIRMITEM handles the creation of a verification sequence in the CmDongle internally. A
CMVALIDATE_DELETEFI structure must be passed here. If the parameter is NULL (==>> cbVerify = 0), no verification sequence is returned. If the buffer is to small for the verification sequence, the return value is larger than the cbVerify value and the error code CMERROR_BUFFER_OVERFLOW is set.
|
CMVALIDATE_DELETEFI contains the data received by a CmDongle after deleting a Firm Item to validate, if a Firm Item is deleted correctly with a Firm Security Box (FSB). Syntax
Parameter mflFiCtrl specifies the type of a Firm Item. This can be one of the following values:
mulFirmCode contains the deleted Firm Code mulSystemTime contains the current value of the System Running Box Clock. This is the number of seconds since 1st January 2000, 0:00:00. This value is used to build the TVB for an authentication that the Firm Item was deleted. mulFirmUpdateCounter contains the final value of the Firm Update Counter. This value is used to build the TVB for an authentication that the Firm Item was deleted. mabTrailingValidationBlock contains a 16-byte Trailing Validation Block (TVB), which may be recalculated by the sender of the Request Sequence that the operation was successfully executed.
|
cbVerify contains the number of bytes of the byte buffer/structure stored in pvVerify.
Return
If the programming task is executed successfully and if pvVerify is NULL, then TRUE is returned, else FALSE is returned.
The following flags (and the corresponding functionality) are only available since CodeMeter Version 4.30:
•CM_GF_ENABLEITEM
•CM_GF_DISABLEITEM
•CM_GF_TEMPENABLEITEM
Syntax
This method is overloaded, i.e. the same method name is used with different type of parameters or different set of parameters.
Method 1:
public bool CmProgram(HCMSysEntry hcmse, GlobalProgrammingOption Option, byte[] Ctrl)
|
This method overload returns true or false.
Method 2:
public bool CmProgram(HCMSysEntry hcmse, GlobalProgrammingOption Option, byte[] Ctrl, out byte[] Verify)
|
This method overload returns true or false
Parameter
hcmse contains a handle opened by CmAccess / CmAccess2. The Access Mode must be Entry Access to a FSB Entry for a regular license. The handle is related to a CmLocal or a CmLAN subsystem with a connected Firm Security Box (FSB). If the license is an evaluation license not needing any security mechanisms like a FSB, the access can be Box Access. To update the IFI of a local CmDongle the access can also be Box Access. The access can be performed to the CmDongle to be programmed or updated. A matching entry in the CmLicensor/CmFirm.wbc file has to exist in both cases.
Option contains one of the following commands:
AddFirmItem calculates the sequence for adding a Firm Item into a CmDongle. Ctrl is pointing to a
CmProgramAddFirmItem class.
|
CmProgramAddFirmItem contains all needed information to add a Firm Item to a CmDongle. The following parameters of the structure are encrypted: musFirm ItemTypeEncrypted to mabSessionId (inclusive). This member defines a sequence of 64 bytes which are encrypted by AES-CBC. The key and the CBC initialization vector depends on the addressed Firm Code and of parameters of the addressed CmDongle. Syntax
Parameter FirmItemReference contains the reserved Firm Item Reference received with CmReserveFirmItem(). FirmItemTypePlain specifies the type of the Firm Item. The following flags using the global enum GlobalActionOption can be set:
PublicLicensorKey contains 64 bytes of ECC Licensor Key which is required to decrypt the specified data via the private Box Key, Serial Key, Firm Common Key and Serial Number of the addressed CmDongle. FirmItemTypeEncrypted (encrypted) specifies the type of the Firm Item. The following flags using the global enum GlobalActionOption can be set:
This value must be equal to FirmItemTypePlain! FirmAccessCounter (encrypted) contains the initial value of the Firm Access Counter. If this member is set to 0xFFFF (the recommended value), this counter is not decremented by an encryption which targets this counter. FirmUpdateCounter (encrypted) contains the initial value of the Firm Update Counter. The recommended value is 0. FirmPreciseTime (encrypted) contains the new Firm Precise Time in seconds since 1st January 2000, 0:00:00. If the value is not used, 0 must be specified, which sets this field to the Running Box Clock value. FirmKey (encrypted) contains the secret Firm Key, which has a fixed length of 32 bytes. SessionId (encrypted) contains the Session ID received with CmReserveFirmItem(). Text contains the text of the Firm Item Text of the Firm Item to program.
|
UpdateFirmItem calculates the sequence for updating a Firm Item in a CmDongle. Ctrl is pointing to a
CmProgramUpdateFirmItem class.
|
CmProgramUpdateFirmItem contains all needed parameters to update a Firm Item. Syntax
Parameter FirmItemReference contains the Firm Item Reference of the Firm Item. Ctrl specifies the flags, which parameters should be updated.
FirmAccessCounter (encrypted) contains the initial value of the Firm Access Counter. If this member is set to 0xFFFF (the recommended value), this counter is not decremented by an encryption which targets this counter. FirmUpdateCounter (encrypted) contains the initial value of the Firm Update Counter. The recommended value is 0. FirmPreciseTime (encrypted) contains the new Firm Precise Time in seconds since 1st January 2000, 0:00:00. If the value is not used, 0 must be specified, which sets this field to the Running Box Clock value. Text contains the text of the Firm Item Text of the Firm Item to program.
|
DeleteFirmItem calculates the sequence for deleting a Firm Item from a CmDongle. Ctrl is pointing to a
CmProgramDeleteFirmItem class.
|
CmProgramDeleteFirmItem contains all parameters needed for deleting a complete Firm Item. Syntax
Parameter FirmItemReference contains the Reference of the Firm Item which has to be removed. TrailingValidationBlock contains a 16-byte TVB (Trailing Validation Block), which must be valid to execute the operation. This TVB is ignored, if the addressed Firm Item was directly created with CmReserveFirmItem().
|
AddProductItem calculates the sequence for adding a Product Item into a CmDongle. Ctrl is pointing to a
CmProgramAddProductItem class.
|
CmProgramAddProductItem contains all needed information to add a Product Item to a CmDongle. All parameters are encrypted. Syntax
Parameter FirmItemReference (encrypted) contains the Reference of the Firm Item for which the Product Item is to be added. If this is 1, the IFI (Implicit Firm Item) is used. The addressed item must not have set the type. 0 is either not permitted. ProductItemSuccessorReference (encrypted) contains the Reference of the Product Item, which will be the successor of the newly added Product Item. If this value is 0, the Product Item is created at the end of the Product Item list. If musFirmItemReference specifies 0 for the IFI, the Product Item may be individually addressed by setting 2 for User Product Item (UPI). 1 for the Common Product Item (CPI) is not permitted because this must be always the first Product Item of the IFI.
|
UpdateProductItem calculates the sequence for updating a Product Item in a CmDongle. Ctrl is pointing to a
CmProgramUpdateProductItem class.
Class CmProgramUpdateProductItem CmProgramUpdateProductItem contains all needed parameters to update a Product Item. Syntax
Parameter FirmItemReference contains the reference of the Firm Item in which the Product Item should be updated. ProductItemReference contains the reference of the Product Item, which should be updated. Ctrl contains flags set internally by the driver.
|
DeleteProductItem calculates the sequence for deleting a Product Item in a CmDongle. Ctrl is pointing to a
CmProgramDeleteProductItem class.
Class CmProgramDeleteProductItem CmProgramDeleteProductItem contains the parameters for deleting a Product Item. Syntax
Parameter FirmItemReference contains the reference of the Firm Item in which the Product Item is deleted. ProductItemReference contains the reference of the Product Item which is to be deleted. TrailingValidationBlock contains the Trailing Validation Block (TVB) which checks, if the delete operation is valid.
|
SetBoxControl calculates the sequence for locking or unlocking a complete CmDongle. Ctrl is pointing to a
CmProgramBoxControl class.
|
CmProgramBoxControl contains the parameters to program the CmDongle control registers. Syntax
Parameter Ctrl specifies the kind of the programming of the CmDongle control registers.
IndicatorFlags contains the two bytes to program or switch.
|
SetFirmKey programs a Firm Key into an already programmed FSB entry in a CmDongle. Ctrl is a 32 element byte array. hcmse must be Entry Access.
SetUserKey tba.
AddEnableBlock calculates the sequence for adding a new Enable Block Item to a Firm Item. Ctrl is a
CmEnablingWriteAdd class.
|
UpdateEnableBlock calculates the sequence for updating an existing Enable Block Item in a Firm Item. Ctrl is a
CmEnablingWriteUpdate class.
|
DeleteEnableBlock calculates the sequence for deleting an existing Enable Block Item from a Firm Item. Ctrl is a
CmEnablingWriteDelete class.
|
CmEnablingWriteDelete describes the request sequence for deleting a Enable Block Item (EBI). command. Syntax
Parameter FirmItemReference contains the reference of the Firm Item which defines the Enabling Block. If this is 0, the IFI (Implicit Firm Item) is used. EnableBlockIndex contains the index of the Enabling Block which is deleted. This must be a value between 0 and 30. TrailingValidationBlock contains the Trailing Validation Block (TVB), which checks whether the delete operation is valid. This is an AES encryption of the SHA-256 hash of the preceding bytes.
|
AttachEnableBlock calculates the sequence for attaching an existing Enable Block Item in a Firm Item. Ctrl is a
CmEnablingWriteAttachDetach class.
Class CmEnablingWriteAttachDetach CmEnablingWriteAttachDetach describes the request sequence for attaching or detaching a Enable Block Item (EBI). Syntax
Parameter EnableLookupEntry contains the Enabling Lookup Entry which defines the attachment. EnableBlockIndex contains the index of the Enabling Block Item which is attached. The subsequent bytes are encrypted by AES-CBC or Triple-DES-CBC. They have a fixed length of 32 bytes. FirmItemReference contains the reference of the Firm Item in which the Enabling Block is attached. If this is 0, the IFI (Implicit Firm Item) is used. ProductItemReference contains the Reference of the Product Item in which the Enabling Block is attached. If the Enabling Block should be attached to the Firm Item, this member must be set to 0. If musFirmItemReference specifies 0, the Product Item may be individually addressed by setting Common Product Item (CPI) or User product item (UPI). FirmUpdateCounter contains the current value of the Firm Update Counter of the Firm Item which owns the Enabling Block. TrailingValidationBlock contains the TVB (Trailing Validation Block), which contains the current hash sequence (16 bytes) to validate that the sequence is correctly encrypted. Notes All parameters set by the user to this structure must be set in Little Endian format! Normally this must be noticed on Big Endian CPU's like the Apple Macintosh. On PC's (x86) the parameters (16 & 32 Bit) are stored in Little Endian so that the user has nothing to mentioned (Little/Big Endian).
|
DetachEnableBlock calculates the sequence for detaching an existing Enable Block Item in a Firm Item. Ctrl is a CmEnablingWriteAttachDetach class.
EnableItem enables the Enabling Block Item defined in the
CmEnablingContext class.
|
CmEnablingContext contains enabling data. It can be collected using CmGetInfo with option EnableInfo. It can be used for enabling using CmProgram. Syntax
Parameter FirmCode contains the Firm Code the enabling block is attached to. ProductCode contains the Product Code the enabling block is attached to. In the case of a value of 0, check mbItemType to see, if it is attached to Product Item with Product Code 0 or to the Firm Item. CmEnablingEnableBlockItem.OptionList specifies the following flags. Valid specifies that the enabling block item is a valid structure. Enabled specifies that the block is permanently enabled. Disabled specifies that the Disabling Flag of the Enable Block Item is set and the block is permanently disabled. TempEnabled specifies that the Enable Block Item is temporarily enabled, independently of the static Enabling Status of the Enable Block Item. For Firmware version smaller than version 1.18 this option is only permitted, if the Enable Block Item is owned by the IFI (Implicit Firm Item = Firm Code 0). EnablingMask can be used to mask bits for specifying the enabling block item Expired specifies an expiration time for the enabling block item. Index specifies the EBI Index inside a Firm Item (or IFI). CmEnablingEnableBlockItem.TypeList specifies the type of the used enabling. This can be one of the following flags: SimplePin specifies that SimplePin enabling is used. TimePin specifies that TimePin enabling is used. DisableTime contains disable time in seconds since the 1st January 2000 0:00:00 (UTC). CmEnablingEnableLookupEntry.OptionList specifies the following flags. Valid specifies that the Enabling Lookup Entry is a valid structure. This flags is always set except the end of the variable-length Enabling Lookup Entry list is reached and 0x0000 is stored. For the an attach or detach request sequence, this flag is ignored. Ifi specifies that the Enabling Block Item of the IFI is used and not of the owning Firm Item. Required specifies that this lookup entry must permit the operation independent to other settings. CmEnableContext.ItemTypeOption specifies the following item types: CmECProductItem specifies that the Enabling Block Item is attached to the Product Item. CmECFirmItem specifies that the Enabling Block Item is attached to the Firm Item. CmECGlobalItem specifies that the Enabling Block Item is attached to the IFI (Implicit Firm Item = Firm Code 0) EnableAccessCodeLen contains the number of bytes which are defined in the Enable Access Code. This must be a value between 2 and 16. CmEnablingEnableLookupEntry.EnableLevelList Enabled specifies the Enable Level. This can be one of the following flags. Locate only the reading of the Firm Code, the Product Code, the Enabling Block Table and the Enabling Lookup Table is permitted. Read the reading of the Firm Item or Product Item is permitted but no operations. Encrypt encryption, decryption and signature calculation is permitted but not with modification of the Unit Counter. UUInitUse encryption, decryption and signature calculation may change the Unit Counter. In a Firm Item, the Firm Update Counter and the Access Counter may be changed. Modify all operations are permitted including modification of the properties by update commands. Detach must be set, if the ELI should be detached. CmEnablingEnableLookupEntry.EnableLevelList specifies the Disable Level. This can be one of the following flags as described for EnableLevel: Text contains the text of the Enabling Block Item. Only available for Time Pin and Finger Pin. EnableAccessCode contains the Enable Access Code. EnablePassword contains the Enable Password.
Note You may either use mabEnableAccessCode or musEnablePassword for enabling / disabling the item depending on the value of mcbEnableAccessCode. If mcbEnableAccessCode is 0, the text in musEnablePassword is used, otherwise the code of musEnableAccessCode is used. CmEnablingContext is supported since CodeMeter Version 4.30.
|
DisableItem disables the Enabling Block Item defined in the CmEnablingContext class.
TempEnableItem enables temporarily the Enabling Block Item defined in the CmEnablingContext class.
SetBoxPassword this option is obsolete; use ChangeBoxPassword instead.
ChangeBoxPassword CmProgramBoxPassword changes the CmDongle Password (UTF-8 character set) in a CmDongle. The input parameters (old and new password) are stored in a CmProgramBoxPassword class. The specified passsword must be 0 terminated.
ResetBoxPassword this option is obsolete; do not use further (resets the cached CmDongle Password).
UpdateCheckoutBorrow
SetBoxPassword2 passes the CmDongle password in (UTF-8 character set) to the CodeMeter Runtime Server. If the CmDongle Password is passed using this option, no dialog will be opened to ask the user for the personal CmDongle password. The specified passsword must be 0 terminated.
ctrl contains a structure depending on the Ctrl flag (see above). The following global flage of the enum CmProgramOption are used:
DefragMemory which cleans up the memory of the CmDongle after the programming step has been performed.
MasterPassword which will use a master password to set the new box password.
Verify contains a byte [] receiving the verification sequence for the programmer. Except of the DeleteFirmItem command this is a signed list command of the added/updated/deleted Firm Item (Signed List of the whole Firm Item). DeleteFirmItem handles the creation of a verification sequence in the CmDongle internally.
Return
If the programming task is executed successfully, then true is returned, else false is returned.
The following flags (and the corresponding functionality) are only available since CodeMeter Version 4.30:
•EnableItem
•DisableItem
•TempEnableItem
Currently not yet documented.